Examples of AnnotationProcessorEnvironment


Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

        String fqn = ((DeclaredType) itemType).getDeclaration().getQualifiedName();
        for (XmlElement xmlElement : xmlElements.value()) {
          DecoratedTypeMirror elementCandidate;
          try {
            Class clazz = xmlElement.type();
            AnnotationProcessorEnvironment env = Context.getCurrentEnvironment();
            DeclaredType declaredType = env.getTypeUtils().getDeclaredType(env.getTypeDeclaration(clazz.getName()));
            elementCandidate = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(declaredType);
          }
          catch (MirroredTypeException e) {
            elementCandidate = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(e.getTypeMirror());
          }
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

      return ((ArrayType) accessorType).getComponentType();
    }
    else if (accessorType.isCollection()) {
      Iterator<TypeMirror> itemTypes = ((DeclaredType) accessorType).getActualTypeArguments().iterator();
      if (!itemTypes.hasNext()) {
        AnnotationProcessorEnvironment env = Context.getCurrentEnvironment();
        Types typeUtils = env.getTypeUtils();
        return TypeMirrorDecorator.decorate(typeUtils.getDeclaredType(env.getTypeDeclaration(java.lang.Object.class.getName())));
      }
      else {
        return itemTypes.next();
      }
    }
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

    Collection<TypeMirror> seeAlsos = null;
    XmlSeeAlso seeAlsoInfo = getAnnotation(XmlSeeAlso.class);
    if (seeAlsoInfo != null) {
      seeAlsos = new ArrayList<TypeMirror>();
      try {
        AnnotationProcessorEnvironment env = Context.getCurrentEnvironment();
        for (Class clazz : seeAlsoInfo.value()) {
          TypeDeclaration typeDeclaration = env.getTypeDeclaration(clazz.getName());
          DeclaredType undecorated = env.getTypeUtils().getDeclaredType(typeDeclaration);
          seeAlsos.add(undecorated);
        }
      }
      catch (MirroredTypesException e) {
        seeAlsos.addAll(e.getTypeMirrors());
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

   */
  public TypeMirror getQNameEnumRef() {
    XmlQNameEnumRef enumRef = getAnnotation(XmlQNameEnumRef.class);
    TypeMirror qnameEnumType = null;
    if (enumRef != null) {
      AnnotationProcessorEnvironment env = Context.getCurrentEnvironment();
      try {
        TypeDeclaration decl = env.getTypeDeclaration(enumRef.value().getName());
        qnameEnumType = env.getTypeUtils().getDeclaredType(decl);
      }
      catch (MirroredTypeException e) {
        qnameEnumType = e.getTypeMirror();
      }
    }
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

   * @param type The type mirror.
   * @return The xml type for the specified type mirror.
   * @throws XmlTypeException If the type is invalid or unknown as an xml type.
   */
  public static XmlType getXmlType(Class type) throws XmlTypeException {
    AnnotationProcessorEnvironment env = Context.getCurrentEnvironment();
    TypeDeclaration declaration = env.getTypeDeclaration(type.getName());
    return getXmlType(env.getTypeUtils().getDeclaredType(declaration));
  }
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

   * @param wrapper        The wrapper.
   * @param alreadyVisited The list of bean names already visited.
   * @return The validation result.
   */
  public ValidationResult validateRequestWrapper(RequestWrapper wrapper, Set<String> alreadyVisited) {
    AnnotationProcessorEnvironment ape = Context.getCurrentEnvironment();
    ValidationResult result = new ValidationResult();

    String requestBeanName = wrapper.getRequestBeanName();
    if (!alreadyVisited.add(requestBeanName)) {
      result.addError(wrapper.getWebMethod(), requestBeanName + " conflicts with another generated bean name.  Please use the @RequestWrapper " +
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

   * @param wrapper        The wrapper.
   * @param alreadyVisited The list of bean names already visited.
   * @return The validation result.
   */
  public ValidationResult validateResponseWrapper(ResponseWrapper wrapper, Set<String> alreadyVisited) {
    AnnotationProcessorEnvironment ape = Context.getCurrentEnvironment();
    ValidationResult result = new ValidationResult();

    String responseBeanName = wrapper.getResponseBeanName();
    if (!alreadyVisited.add(responseBeanName)) {
      result.addError(wrapper.getWebMethod(), responseBeanName + " conflicts with another generated bean name.  Please use the @ResponseWrapper " +
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment

       
        Iterator iter = classes.iterator();
        while ( iter.hasNext() )
        {
            SourceClass sourceClass = ( SourceClass ) iter.next();
            AnnotationProcessorEnvironment env = AnnotationProcessorEnvironmentImpl.get( getContext(), this, sourceClass );
            AnnotationTypeDeclaration[] decls = DeclarationImpl.getAllAnnotations();    // TODO: filter appropriately
           
            PageFlowAnnotationProcessor pfap = new PageFlowAnnotationProcessor( decls, env );
           
            try
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment

        super( annotationTypeDecls, env );
    }

    public BaseChecker getChecker( ClassDeclaration classDecl, Diagnostics diagnostics )
    {
        AnnotationProcessorEnvironment env = getAnnotationProcessorEnvironment();
       
        if ( CompilerUtils.isAssignableFrom( JPF_BASE_CLASS, classDecl, env ) )
        {
            if ( expectAnnotation( classDecl, CONTROLLER_TAG_NAME, JPF_FILE_EXTENSION_DOT, JPF_BASE_CLASS, diagnostics ) )
            {
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment

        return null;
    }

    public BaseGenerator getGenerator( ClassDeclaration classDecl, Diagnostics diags )
    {
        AnnotationProcessorEnvironment env = getAnnotationProcessorEnvironment();
        SourceFileInfo sourceFileInfo = getSourceFileInfo( classDecl );
       
        if ( CompilerUtils.isAssignableFrom( JPF_BASE_CLASS, classDecl, env ) )
        {
            assert sourceFileInfo != null : classDecl.getQualifiedName();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.