If you think the Android project JsonPullParser listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package net.vvakame.util.jsonpullparser.builder;
//fromwww.java2s.com/**
* Builder factory.
* @author vvakame
* @param <T>
* @param <P>
*/publicclass JsonPropertyMeta<T, P> implements JsonPropertyBuilderCreator<T> {
private Class<? extends JsonPropertyCoder<T, P>> coderClass;
private String name;
@Override
@SuppressWarnings("unchecked")
public JsonPropertyBuilder<T, P> get() {
return getBuilder();
}
/**
* the constructor.
* @param coderClass
* @param name
* @category constructor
*/public JsonPropertyMeta(Class<? extends JsonPropertyCoder<T, P>> coderClass, String name) {
this.coderClass = coderClass;
this.name = name;
}
JsonPropertyBuilder<T, P> getBuilder() {
returnnew JsonPropertyBuilder<T, P>(coderClass, name, null, null);
}
/**
* Gets a new instance of property builder for the given key name.
* @param name
* @return a new property builder instance
* @author vvakame
*/public JsonPropertyBuilder<T, P> name(String name) {
returnnew JsonPropertyBuilder<T, P>(coderClass, name, null, null);
}
/**
* Gets a new instance of property builder for the given value coder.
* @param coder
* @return a new property builder instance
* @author vvakame
*/public JsonPropertyBuilder<T, P> coder(JsonModelCoder<P> coder) {
returnnew JsonPropertyBuilder<T, P>(coderClass, name, coder, null);
}
/**
* Gets a new instance of property builder for the given coder router.
* @param router
* @return a new property builder instance
* @author vvakame
*/public JsonPropertyBuilder<T, P> router(JsonCoderRouter<P> router) {
returnnew JsonPropertyBuilder<T, P>(coderClass, name, null, router);
}
}