Package com.google.gwt.core.ext.typeinfo

Examples of com.google.gwt.core.ext.typeinfo.TypeOracle


        }
    }

    public String doGenerate(TreeLogger logger, GeneratorContext context, String typeName) throws Exception {

        TypeOracle typeOracle = context.getTypeOracle();
        JClassType type = typeOracle.getType(typeName);
        String packageName = type.getPackage().getName();
        String simpleClassName = type.getSimpleSourceName();

        String beanClassName = simpleClassName + "Impl";
        String qualifiedBeanClassName = packageName + "." + beanClassName;
View Full Code Here


        this.logger = logger;
        this.context = context;
    }

    public void scan(ScannedTypeProcessor... processors) {
        TypeOracle typeOracle = context.getTypeOracle();
        for (JClassType type : typeOracle.getTypes()) {
            for (ScannedTypeProcessor processor : processors) {
                processor.process(type);
            }
        }
        for (ScannedTypeProcessor processor : processors) {
View Full Code Here

*/
public class MulticasterClassGenerator extends Generator {

    public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException {
        Set<JClassType> eventTypes = new HashSet<JClassType>();
        TypeOracle typeOracle = context.getTypeOracle();
        JClassType type = typeOracle.findType(typeName);
        if (type.isAnnotationPresent(EventPackages.class)) {
            JClassType eventType = typeOracle.findType(ApplicationEvent.class.getName());
            EventPackages eventPackages = type.getAnnotation(EventPackages.class);
            String[] patterns = eventPackages.value();
            for (JPackage pkg : typeOracle.getPackages()) {
                for (String pattern : patterns) {
                    if (pkg.getName().matches(pattern)) {
                        addEventTypes(pkg, eventTypes, eventType);
                    }
                }
View Full Code Here

        }
        return generate(new EasyTreeLogger(logger), type, eventTypes, context);
    }

    public static String generate(EasyTreeLogger logger, JClassType multicasterType, Set<JClassType> eventTypes, GeneratorContext context) throws UnableToCompleteException {
        TypeOracle typeOracle = context.getTypeOracle();
        String packageName = multicasterType.getPackage().getName();

        String newClassName = multicasterType.getSimpleSourceName() + "Impl";
        String newQualifiedClassName = packageName + "." + newClassName;
        SourceWriter sourceWriter = getSourceWriter(logger, context, packageName, multicasterType, newClassName);
View Full Code Here

        if (actualHandlers.isEmpty()) {
            return null;
        }

        TypeOracle typeOracle = context.getTypeOracle();
        String packageName = componentType.getPackage().getName();

        String className = componentType.getSimpleSourceName() + "_EventListener";
        String qualifiedBeanClassName = packageName + "." + className;
        SourceWriter sourceWriter = getSourceWriter(logger, context, packageName, className);
View Full Code Here

 

  @Override
  public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException {

    TypeOracle typeOracle = context.getTypeOracle();
    PropertyOracle propOracle = context.getPropertyOracle();
    ResourceOracle resOracle = context.getResourcesOracle();
   
    JClassType classType;
    try {
      classType = typeOracle.getType(typeName);
    } catch (NotFoundException e) {
      e.printStackTrace();
      return null;
    }
   
View Full Code Here

    urlExpression = context.deploy(context.getClientBundleType()
        .getQualifiedSourceName().replace('.', '_')
        + "_jsonbundle.txt", "text/plain", data.toString().getBytes(),
        true);

    TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle();
    JClassType stringType = typeOracle.findType(String.class.getName());
    assert stringType != null;

    externalSVGUrlIdent = fields.define(stringType, "externalSVGUrl",
        urlExpression, true, true);

    JClassType textResourceType = typeOracle.findType(SVGResource.class
        .getName());
    assert textResourceType != null;
    JType textResourceArrayType = typeOracle.getArrayType(textResourceType);

    externalSVGCacheIdent = fields.define(textResourceArrayType,
        "externalSVGCache", "new " + SVGResource.class.getName()
            + "[" + currentIndex + "]", true, true);
  }
View Full Code Here

    } else if ("empty".equals(classPrefix)) {
      classPrefix = "";
    }

    // Find all of the types that we care about in the type system
    TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle();

    cssResourceType = typeOracle.findType(CssResource.class.getName());
    assert cssResourceType != null;

    elementType = typeOracle.findType(Element.class.getName());
    assert elementType != null;

    stringType = typeOracle.findType(String.class.getName());
    assert stringType != null;

    replacementsByClassAndMethod = new IdentityHashMap<JClassType, Map<JMethod, String>>();
    replacementsForSharedMethods = new IdentityHashMap<JMethod, String>();
    stylesheetMap = new IdentityHashMap<JMethod, CssStylesheet>();
View Full Code Here

  }

  @Override
  public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException
  {
    TypeOracle typeOracle = context.getTypeOracle();
   
    JClassType userType;
    try
    {
      userType = typeOracle.getType(typeName);
    }
    catch (NotFoundException e)
    {
      logger.log(TreeLogger.ERROR, "Unable to find metadata for type: " + typeName, e);
      throw new UnableToCompleteException();
View Full Code Here

  {
    try
    {
    //  Get target class
    //
      TypeOracle typeOracle = context.getTypeOracle();
      JClassType requestedClass = typeOracle.getType(typeName);
     
      // Do not generate proxy for a class already implementing
      // ILightEntity interface
      if (isLazyPojo(requestedClass) == true)
      {
View Full Code Here

TOP

Related Classes of com.google.gwt.core.ext.typeinfo.TypeOracle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.