当前位置: 首页>>代码示例>>Java>>正文


Java NotFoundException类代码示例

本文整理汇总了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;
  }
 
开发者ID:TOMOTON,项目名称:gwt-dagger2,代码行数:31,代码来源:VersionGenerator.java

示例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();
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:25,代码来源:HexaCssGenerator.java

示例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();
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:26,代码来源:ClazzGenerator.java

示例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;
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:23,代码来源:ServiceBinderCreator.java

示例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();
   }
}
 
开发者ID:symulakr,项目名称:gwt-generators,代码行数:17,代码来源:CellTableGenerator.java

示例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();
  }
}
 
开发者ID:google,项目名称:gwteventbinder,代码行数:21,代码来源:EventBinderGenerator.java

示例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();
  }
}
 
开发者ID:ekuefler,项目名称:gwt-supereventbus,代码行数:22,代码来源:EventRegistrationGenerator.java

示例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();
    }
}
 
开发者ID:rfilippone,项目名称:gwt-dom-event-binder,代码行数:21,代码来源:DomEventBinderGenerator.java

示例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();
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:34,代码来源:TemplateGwtGenerator.java

示例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;
	}
}
 
开发者ID:gilberto-torrezan,项目名称:gwt-views,代码行数:34,代码来源:PresenterGenerator.java

示例11: getMethod

import com.google.gwt.core.ext.typeinfo.NotFoundException; //导入依赖的package包/类
@Override
public JMethod getMethod(String name,
                         JType[] paramTypes)
  throws NotFoundException {

  return null;
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:8,代码来源:StubClassType.java

示例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;
  }
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:10,代码来源:BeanHelper.java

示例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;
    }
 
开发者ID:kyoken74,项目名称:gwt-angular,代码行数:16,代码来源:AbstractGenerator.java

示例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("}");
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:33,代码来源:InjectorModuleCreator.java

示例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;
}
 
开发者ID:ahome-it,项目名称:ahome-core,代码行数:34,代码来源:UiBinderGenerator.java


注:本文中的com.google.gwt.core.ext.typeinfo.NotFoundException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。