本文整理汇总了Java中com.google.web.bindery.autobean.shared.AutoBeanFactory类的典型用法代码示例。如果您正苦于以下问题:Java AutoBeanFactory类的具体用法?Java AutoBeanFactory怎么用?Java AutoBeanFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AutoBeanFactory类属于com.google.web.bindery.autobean.shared包,在下文中一共展示了AutoBeanFactory类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSourceWriter
import com.google.web.bindery.autobean.shared.AutoBeanFactory; //导入依赖的package包/类
private SourceWriter getSourceWriter(TreeLogger logger, GeneratorContext ctx, JClassType intfType) {
JPackage serviceIntfPkg = intfType.getPackage();
String packageName = serviceIntfPkg == null ? "" : serviceIntfPkg.getName();
PrintWriter printWriter = ctx.tryCreate(logger, packageName, getTypeSimpleName());
if (printWriter == null) {
return null;
}
ClassSourceFileComposerFactory composerFactory =
new ClassSourceFileComposerFactory(packageName, getTypeSimpleName());
String[] imports = new String[]{
// java.util
ArrayList.class.getCanonicalName(),
Collection.class.getCanonicalName(),
List.class.getCanonicalName(),
Iterator.class.getCanonicalName(),
Set.class.getCanonicalName(),
// com.google.gwt.core.client
GWT.class.getCanonicalName(),
// com.google.web.bindery.autobean.shared
AutoBean.class.getCanonicalName(),
AutoBeanCodex.class.getCanonicalName(),
AutoBeanFactory.class.getCanonicalName(),
AutoBeanUtils.class.getCanonicalName(),
// io.reinert.requestor.serialization
DeserializationContext.class.getCanonicalName(),
Deserializer.class.getCanonicalName(),
HasImpl.class.getCanonicalName(),
Serdes.class.getCanonicalName(),
Serializer.class.getCanonicalName(),
SerializationContext.class.getCanonicalName(),
UnableToDeserializeException.class.getName(),
UnableToSerializeException.class.getName(),
// io.reinert.requestor.serialization.json
JsonObjectSerdes.class.getCanonicalName(),
JsonRecordReader.class.getCanonicalName(),
JsonRecordWriter.class.getCanonicalName(),
};
for (String imp : imports) {
composerFactory.addImport(imp);
}
composerFactory.addImplementedInterface(intfType.getErasedType().getQualifiedSourceName());
return composerFactory.createSourceWriter(ctx, printWriter);
}
示例2: getAutoBeanFactory
import com.google.web.bindery.autobean.shared.AutoBeanFactory; //导入依赖的package包/类
/**
* Returns an AutoBeanFactory that can produce the types reachable only from this RequestContext.
*/
protected abstract AutoBeanFactory getAutoBeanFactory();
示例3: XmlReader
import com.google.web.bindery.autobean.shared.AutoBeanFactory; //导入依赖的package包/类
/**
* Creates a new XML reader that can turn XML into an AutoBean.
*
* @param factory an auto bean factory capable of encoding objects of type M
* @param rootBeanType AutoBean based type to represent the base data
*/
public XmlReader(AutoBeanFactory factory, Class<Base> rootBeanType) {
super(factory, rootBeanType);
}