本文整理汇总了Java中com.google.gwt.core.ext.typeinfo.NotFoundException类的典型用法代码示例。如果您正苦于以下问题:Java NotFoundException类的具体用法?Java NotFoundException怎么用?Java NotFoundException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotFoundException类属于com.google.gwt.core.ext.typeinfo包,在下文中一共展示了NotFoundException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generate
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException {
String result = null;
try {
String version = findVersion(logger, context);
JClassType classType = context.getTypeOracle().getType(typeName);
String packageName = packageNameFrom(classType);
String simpleName = simpleNameFrom(classType);
result = packageName + '.' + simpleName;
SourceWriter source = getSourceWriter(logger, context, classType);
if(source != null) { //? Otherwise, work needs to be done.
source.println();
source.println("private String value;");
source.println();
source.println("public " + simpleName + "() {");
populateInstanceFactory(logger, context, typeName, source, version);
source.println("}");
source.println();
source.println("@Override");
source.println("public String getValue() {");
source.println(" return value;");
source.println("}");
source.println(); source.commit(logger);
//emitVersionArtifact(logger, context, version);
}
} catch (NotFoundException nfe) {
logger.log(Type.ERROR, "Could not find extension point type '" + typeName + "'!", nfe);
throw new UnableToCompleteException();
}
return result;
}
示例2: generate
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
public String generate( TreeLogger logger, GeneratorContext context, String typeName ) throws UnableToCompleteException
{
this.logger = logger;
this.context = context;
this.typeName = typeName;
if( typeName == null )
return null;
typeOracle = context.getTypeOracle();
try
{
type = typeOracle.getType( typeName );
}
catch( NotFoundException e )
{
e.printStackTrace();
throw new RuntimeException( e );
}
return generate();
}
示例3: getReflectedType
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
private JClassType getReflectedType( TypeOracle typeOracle, String askedTypeName ) throws UnableToCompleteException
{
JClassType askedType;
try
{
askedType = typeOracle.getType( askedTypeName );
}
catch( NotFoundException e )
{
throw new UnableToCompleteException();
}
for( JClassType classType : askedType.getImplementedInterfaces() )
{
if( !classType.getQualifiedSourceName().equals( "fr.lteconsulting.hexa.classinfo.Clazz" ) )
continue;
JParameterizedType parametrized = classType.isParameterized();
JClassType[] typeArgs = parametrized.getTypeArgs();
return typeArgs[0];
}
throw new UnableToCompleteException();
}
示例4: create
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
public String create(TreeLogger logger, GeneratorContext context) throws UnableToCompleteException, NotFoundException {
PrintWriter printWriter = this.getPrintWriter(logger, context);
if (printWriter == null) {
return this.proxyModelQualifiedName;
}
this.serializerTypeName = this.createSerializer(logger, context);
this.collectImports();
SourceWriter srcWriter = this.getSourceWriter(printWriter, context);
srcWriter.indent();
srcWriter.println();
this.generateSerializer(srcWriter);
srcWriter.println();
this.generateServiceImplementation(logger, srcWriter);
this.generateServiceImplementationWithCallback(logger, srcWriter);
srcWriter.outdent();
srcWriter.commit(logger);
return this.proxyModelQualifiedName;
}
示例5: populateVelocityContext
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
protected void populateVelocityContext(VelocityContext velocityContext, TypeOracle typeOracle, JClassType modelType)
throws UnableToCompleteException
{
try
{
super.populateVelocityContext(velocityContext, typeOracle, modelType);
TableContext tableContext = new TableContext(typeOracle, modelType);
velocityContext.put("generatorType", getClass());
velocityContext.put(TABLE_CONTEXT_KEY, tableContext);
}
catch (NotFoundException e)
{
throw new UnableToCompleteException();
}
}
示例6: generate
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
public String generate(TreeLogger logger, GeneratorContext context,
String typeName) throws UnableToCompleteException {
try {
JClassType eventBinderType = context.getTypeOracle().getType(typeName);
JClassType targetType = getTargetType(eventBinderType, context.getTypeOracle());
SourceWriter writer = createSourceWriter(logger, context, eventBinderType, targetType);
if (writer != null) { // Otherwise the class was already created
new EventBinderWriter(
logger,
context.getTypeOracle().getType(GenericEvent.class.getCanonicalName()))
.writeDoBindEventHandlers(targetType, writer, context.getTypeOracle());
writer.commit(logger);
}
return getFullyQualifiedGeneratedClassName(eventBinderType);
} catch (NotFoundException e) {
logger.log(Type.ERROR, "Error generating " + typeName, e);
throw new UnableToCompleteException();
}
}
示例7: generate
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
public String generate(TreeLogger logger, GeneratorContext context, String typeName)
throws UnableToCompleteException {
try {
JClassType eventBinderType = context.getTypeOracle().getType(typeName);
JClassType targetType = getTargetType(eventBinderType, context.getTypeOracle());
SourceWriter writer = createSourceWriter(logger, context, eventBinderType, targetType);
if (writer != null) { // Otherwise the class was already created
new EventRegistrationWriter(logger).writeGetMethods(targetType, writer);
writer.commit(logger);
}
return new StringBuilder()
.append(eventBinderType.getPackage().getName())
.append('.')
.append(getSimpleGeneratedClassName(eventBinderType))
.toString();
} catch (NotFoundException e) {
logger.log(Type.ERROR, "Error generating " + typeName, e);
throw new UnableToCompleteException();
}
}
示例8: generate
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException {
try {
TypeOracle typeOracle = context.getTypeOracle();
JClassType eventBinderType = typeOracle.getType(typeName);
JClassType targetType = getTargetType(eventBinderType, typeOracle);
SourceWriter writer = createSourceWriter(logger, context, eventBinderType, targetType);
if (writer != null) {
write_doBindEventHandlers(targetType, typeOracle, writer, logger);
writer.commit(logger);
}
return getFullyQualifiedGeneratedClassName(eventBinderType);
} catch (NotFoundException e) {
logger.log(Type.ERROR, "Error generating " + typeName, e);
throw new UnableToCompleteException();
}
}
示例9: generate
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
public String generate(TreeLogger logger, GeneratorContext generatorContext, String typeName)
throws UnableToCompleteException
{
TypeOracle types = generatorContext.getTypeOracle();
ClassName componentTypeName = ClassName.bestGuess(typeName.substring(0,
typeName.length() - COMPONENT_TEMPLATE_SUFFIX.length()));
JClassType componentJsType;
try
{
componentJsType =
types.getType(componentJsTypeName(componentTypeName).reflectionName());
}
catch (NotFoundException nfe)
{
logger.log(Type.ERROR, "Not Found", nfe);
throw new UnableToCompleteException();
}
ClassName templateImplTypeName = componentTemplateImplName(componentTypeName);
PrintWriter printWriter = generatorContext.tryCreate(logger,
templateImplTypeName.packageName(),
templateImplTypeName.simpleName());
if (printWriter != null)
{
generateOnce(printWriter, logger, generatorContext, componentJsType, componentTypeName);
}
return templateImplTypeName.reflectionName();
}
示例10: getInjectorMethod
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
private String getInjectorMethod(TreeLogger logger, JClassType injector, String injectorMethod, String className) throws UnableToCompleteException {
if (injectorMethod != null && !injectorMethod.isEmpty()){
try {
injector.getMethod(injectorMethod, new JType[0]);
}
catch (NotFoundException e) {
logger.log(Type.WARN, "The injector method \"" + injectorMethod + "\" was not found on class " + injector.getQualifiedSourceName());
//a compiler error will be trigged if the method really doesn't exist
}
return injectorMethod;
}
else {
String methodName = null;
JMethod[] methods = injector.getInheritableMethods();
for (JMethod method : methods) {
JType returnType = method.getReturnType();
if (returnType.getQualifiedSourceName().equals(className)){
if (methodName != null){
logger.log(Type.ERROR, "The injector " + injector.getName() + " has more than one method with " + className
+ " as return type. Use the \"injectorMethod\" property to specify which one should be used.");
throw new UnableToCompleteException();
}
methodName = method.getName();
}
}
if (methodName == null){
logger.log(Type.INFO, "The injector " + injector.getName() + " has no methods with " + className
+ " as return type. The View will not be injected.");
return null;
}
return methodName;
}
}
示例11: getMethod
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
public JMethod getMethod(String name,
JType[] paramTypes)
throws NotFoundException {
return null;
}
示例12: hasGetter
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
boolean hasGetter(final PropertyDescriptor ppropertyDescriptor) {
final JType[] paramTypes = new JType[] {};
try {
this.jclass.getMethod(GwtSpecificValidatorCreator.asGetter(ppropertyDescriptor), paramTypes);
return true;
} catch (final NotFoundException e) {
return false;
}
}
示例13: getClassType
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
protected JClassType getClassType(GeneratorContext context, String qualifiedClassName) throws RebindException {
final String METHOD = "getClassType(GeneratorContext, String)";
JClassType classType = null;
try {
TypeOracle typeOracle = context.getTypeOracle();
classType = typeOracle.getType(qualifiedClassName);
} catch (NotFoundException e) {
String m = qualifiedClassName + " was not found";
LOG.logp(Level.SEVERE, CLASS, METHOD, m);
throw new RebindException(m);
}
return classType;
}
示例14: doCreate
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
protected void doCreate(TreeLogger logger, GeneratorContext context, SourceWriter srcWriter) {
super.doCreate(logger, context, srcWriter);
srcWriter.println("@Override public void onModuleLoad() {");
srcWriter.indent();
try {
if (this.injectableType.getMethod("onModuleLoad", new JType[] {}) != null) {
srcWriter.println("super.onModuleLoad();");
}
} catch (NotFoundException e) {
srcWriter.println("");
}
for (InjectorWritterEntryPoint delegate : Iterables.filter(this.delegates, InjectorWritterEntryPoint.class)) {
delegate.writeEntryPoint(srcWriter);
srcWriter.println();
}
for (JMethod method : InjectCreatorUtil.listMethod(this.injectableType, EntryPointHandler.class)) {
srcWriter.println("super.%s();", method.getName());
}
srcWriter.println();
MvpDescription mvpAnnotation = this.injectableType.getAnnotation(MvpDescription.class);
if (mvpAnnotation != null && mvpAnnotation.handleCurrentHistory()) {
srcWriter.println("MvpController.get().handleCurrentHistory();");
}
srcWriter.outdent();
srcWriter.println("}");
}
示例15: generate
import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
public String generate(TreeLogger logger, GeneratorContext genCtx,
String fqInterfaceName) throws UnableToCompleteException {
TypeOracle oracle = genCtx.getTypeOracle();
JClassType interfaceType;
try {
interfaceType = oracle.getType(fqInterfaceName);
} catch (NotFoundException e) {
throw new RuntimeException(e);
}
DesignTimeUtils designTime;
if (DesignTimeUtilsImpl.isDesignTime(fqInterfaceName)) {
designTime = new DesignTimeUtilsImpl();
} else {
designTime = DesignTimeUtilsStub.EMPTY;
}
String implName = interfaceType.getName().replace('.', '_') + "Impl";
implName = designTime.getImplName(implName);
String packageName = interfaceType.getPackage().getName();
PrintWriterManager writers = new PrintWriterManager(genCtx, logger,
packageName);
PrintWriter printWriter = writers.tryToMakePrintWriterFor(implName);
if (printWriter != null) {
generateOnce(interfaceType, implName, printWriter, logger, oracle,
genCtx.getResourcesOracle(), genCtx.getPropertyOracle(), writers, designTime);
}
return packageName + "." + implName;
}