This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class ApplicationContextProvider implements ApplicationContextAware { | |
private static ApplicationContext context; | |
public static ApplicationContext getApplicationContext() { | |
return context; | |
} | |
@Override | |
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | |
context = applicationContext; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* コード値からenumインスタンスを検索するクラス | |
* | |
* http://d.hatena.ne.jp/penult/20110523/1306161406 | |
* | |
*/ | |
public class Decoder<K extends Serializable, V extends Encodable<K>> { | |
private Map<K, V> map; | |
private Decoder(V[] values) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Ascii文字制約 | |
*/ | |
@Documented | |
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER }) | |
@Retention(RetentionPolicy.RUNTIME) | |
@Constraint(validatedBy = {}) | |
@Pattern(regexp = "[\\x00-\\x7F]*") | |
public @interface Ascii { | |
String message() default "dv3j.core.validation.Ascii.message"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Documented | |
@Constraint(validatedBy = UniqueValidator.class) | |
@Target({ ElementType.TYPE}) | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface Unique { | |
String message() default "dv3j.core.validation.Unique.message"; | |
Class<?>[] groups() default {}; | |
Class<? extends Payload>[] payload() default {}; | |
Class<?> entity(); | |
String[] property(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* DomツリーからXPathでノードを選択するクラス。 | |
*/ | |
public class DomNode { | |
private static XPathFactory xpathFactory = XPathFactory.newInstance(); | |
private Optional<Node> node; | |
public DomNode(Node node) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<Integer, List<String>> list4 = Stream.of("a", "b") | |
.collect(Collectors.groupingBy( | |
String::length, | |
Collectors.toCollection(() -> new ArrayList<String>()) | |
)); | |
Map<Integer, List<? extends String>> list5 = Stream.of("a", "b") | |
.collect(Collectors.groupingBy( | |
String::length, | |
Collector.of( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@AllArgsConstructor | |
public class Item { | |
public String id; | |
public String title; | |
public User user; | |
public List<Tag> tags; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- index.html --> | |
<html> | |
<head> | |
<title>Qiitaトレンド</title> | |
<meta charset="UTF-8"/> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> | |
<link href="http://nvd3.org/assets/css/nv.d3.css" rel="stylesheet" type="text/css"> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static java.util.Spliterator.*; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.nio.charset.StandardCharsets; | |
import java.util.Iterator; | |
import java.util.Spliterator; | |
import java.util.Spliterators; | |
import java.util.function.Consumer; | |
import java.util.stream.Stream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LocalDateTime d = LocalDateTime.now(); |