Examples of AnnotationProcessorEnvironment


Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

    DecoratedTypeMirror returnType = (DecoratedTypeMirror) getReturnType();

    try {
      Class<?> outputType = signatureOverride.output();
      if (outputType != ResourceMethodSignature.NONE.class) {
        AnnotationProcessorEnvironment env = net.sf.jelly.apt.Context.getCurrentEnvironment();
        TypeDeclaration type = env.getTypeDeclaration(outputType.getName());
        return new ResourceRepresentationMetadata(env.getTypeUtils().getDeclaredType(type), returnType.getDocValue());
      }
    }
    catch (MirroredTypeException e) {
      DecoratedTypeMirror typeMirror = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(e.getTypeMirror());
      if (typeMirror.isDeclared()) {
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

   */
  protected ResourceEntityParameter loadEntityParameter(ResourceMethodSignature signatureOverride) {
    try {
      Class<?> entityType = signatureOverride.input();
      if (entityType != ResourceMethodSignature.NONE.class) {
        AnnotationProcessorEnvironment env = net.sf.jelly.apt.Context.getCurrentEnvironment();
        TypeDeclaration type = env.getTypeDeclaration(entityType.getName());
        return new ResourceEntityParameter(type, env.getTypeUtils().getDeclaredType(type));
      }
    }
    catch (MirroredTypeException e) {
      DecoratedTypeMirror typeMirror = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(e.getTypeMirror());
      if (typeMirror.isDeclared()) {
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

    TypeMirror typeMirror;
    TypeHint hintInfo = getAnnotation(TypeHint.class);
    if (hintInfo != null) {
      try {
        Class hint = hintInfo.value();
        AnnotationProcessorEnvironment env = net.sf.jelly.apt.Context.getCurrentEnvironment();
        if (TypeHint.NO_CONTENT.class.equals(hint)) {
          typeMirror = env.getTypeUtils().getVoidType();
        }
        else {
          String hintName = hint.getName();

          if (TypeHint.NONE.class.equals(hint)) {
            hintName = hintInfo.qualifiedName();
          }

          if (!"##NONE".equals(hintName)) {
            TypeDeclaration type = env.getTypeDeclaration(hintName);
            typeMirror = TypeMirrorDecorator.decorate(env.getTypeUtils().getDeclaredType(type));
          }
          else {
            typeMirror = delegate.getType();
          }
        }
      }
      catch (MirroredTypeException e) {
        typeMirror = e.getTypeMirror();
      }
    }
    else {
      typeMirror = delegate.getType();

      if (getJavaDoc().get("inputWrapped") != null) { //support jax-doclets. see http://jira.codehaus.org/browse/ENUNCIATE-690
        String fqn = getJavaDoc().get("inputWrapped").get(0);
        AnnotationProcessorEnvironment env = net.sf.jelly.apt.Context.getCurrentEnvironment();
        TypeDeclaration type = env.getTypeDeclaration(fqn);
        if (type != null) {
          typeMirror = TypeMirrorDecorator.decorate(env.getTypeUtils().getDeclaredType(type));
        }
      }
    }
   
    this.type = typeMirror;
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

   * @param method The method.
   * @param resourceMethods The method list.
   * @return If the methdo is overridden by any of the methods in the list.
   */
  protected boolean isOverridden(DecoratedDeclaration method, ArrayList<? extends DecoratedDeclaration> resourceMethods) {
    AnnotationProcessorEnvironment env = Context.getCurrentEnvironment();
    Declarations decls = env.getDeclarationUtils();

    Declaration unwrappedMethod = method.getDelegate();
    while (unwrappedMethod instanceof DecoratedDeclaration) {
      unwrappedMethod = ((DecoratedDeclaration) unwrappedMethod).getDelegate();
    }
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

   * @param param The param to test.
   * @param resourceParameters The other parameters.
   * @return If the parameter is hidden by any of the parameters in the specified list.
   */
  private boolean isHidden(ResourceParameter param, List<ResourceParameter> resourceParameters) {
    AnnotationProcessorEnvironment env = Context.getCurrentEnvironment();
    Declarations decls = env.getDeclarationUtils();

    Declaration unwrappedParam = param.getDelegate();
    while (unwrappedParam instanceof DecoratedDeclaration) {
      unwrappedParam = ((DecoratedDeclaration) unwrappedParam).getDelegate();
    }
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

  protected void addSeeAlsoTypeDefinitions(Declaration declaration) {
    XmlSeeAlso seeAlso = declaration.getAnnotation(XmlSeeAlso.class);
    if (seeAlso != null) {
      try {
        Class[] classes = seeAlso.value();
        AnnotationProcessorEnvironment ape = Context.getCurrentEnvironment();
        for (Class clazz : classes) {
          ClassType type = (ClassType) ape.getTypeUtils().getDeclaredType(ape.getTypeDeclaration(clazz.getName()));
          ClassDeclaration typeDeclaration = type.getDeclaration();
          if (typeDeclaration != null) {
            addSeeAlsoReference(typeDeclaration);
          }
        }
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

    XmlSeeAlso seeAlso = declaration.getAnnotation(XmlSeeAlso.class);
    if (seeAlso != null) {
      try {
        Class[] classes = seeAlso.value();
        AnnotationProcessorEnvironment ape = Context.getCurrentEnvironment();
        for (Class clazz : classes) {
          ClassType type = (ClassType) ape.getTypeUtils().getDeclaredType(ape.getTypeDeclaration(clazz.getName()));
          ClassDeclaration typeDeclaration = type.getDeclaration();
          if (typeDeclaration != null) {
            addJsonType(JsonTypeDefinition.createTypeDefinition(typeDeclaration));
          }
        }
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

      else if (isAnyAttribute(accessor)) {
        hasAnyAttribute = true;

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

Examples of com.sun.mirror.apt.AnnotationProcessorEnvironment

  protected boolean overrides(DecoratedMethodDeclaration method) {
    if (method == null) {
      return false;
    }
   
    AnnotationProcessorEnvironment env = Context.getCurrentEnvironment();
    Declarations decls = env.getDeclarationUtils();

    Declaration unwrappedMethod = method.getDelegate();
    while (unwrappedMethod instanceof DecoratedDeclaration) {
      unwrappedMethod = ((DecoratedDeclaration) unwrappedMethod).getDelegate();
    }
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
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.