Package com.sun.mirror.declaration

Examples of com.sun.mirror.declaration.ClassDeclaration


    private AptControlImplementation initSuperClass()
    {
        if ( _implDecl == null || _implDecl.getSuperclass() == null )
            return null;
       
        ClassDeclaration superDecl = _implDecl.getSuperclass().getDeclaration();
        if (superDecl != null &&
            superDecl.getAnnotation(org.apache.beehive.controls.api.bean.ControlImplementation.class) != null)
        {
            return new AptControlImplementation(superDecl, _ap);
        }
       
        return null;
View Full Code Here


        this.primitiveByte = env.getTypeUtils().getPrimitiveType(PrimitiveType.Kind.BYTE);
    }

    public TypeDeclaration getSuperClass(TypeDeclaration t) {
        if (t instanceof ClassDeclaration) {
            ClassDeclaration c = (ClassDeclaration) t;
            ClassType sup = c.getSuperclass();
            if(sup!=null)
                return sup.getDeclaration();
            else
                return null;
        }
View Full Code Here

    public boolean isBridgeMethod(MethodDeclaration method) {
        return method.getModifiers().contains(Modifier.VOLATILE);
    }

    public boolean isOverriding(MethodDeclaration method, TypeDeclaration base) {
        ClassDeclaration sc = (ClassDeclaration) base;

        Declarations declUtil = env.getDeclarationUtils();

        while(true) {
            for (MethodDeclaration m : sc.getMethods()) {
                if(declUtil.overrides(method,m))
                    return true;
            }

            if(sc.getSuperclass()==null)
                return false;
            sc = sc.getSuperclass().getDeclaration();
        }
    }
View Full Code Here

    public boolean hasDefaultConstructor(TypeDeclaration t) {
        if(!(t instanceof ClassDeclaration))
            return false;

        ClassDeclaration c = (ClassDeclaration) t;
        for( ConstructorDeclaration init : c.getConstructors() ) {
            if(init.getParameters().isEmpty())
                return true;
        }
        return false;
    }
View Full Code Here

        throw new ValidationException(getPosition(), "Member " + getName() + " of " + getTypeDefinition().getQualifiedName() + ": @XmlElementRef annotates a type JAXBElement without specifying the name of the JAXB element.");
      }
      refQName = new QName(namespace, localName);
    }
    else if (declaration instanceof ClassDeclaration && declaration.getAnnotation(XmlRootElement.class) != null) {
      ClassDeclaration classDeclaration = (ClassDeclaration) declaration;
      RootElementDeclaration refElement = new RootElementDeclaration(classDeclaration, ((EnunciateFreemarkerModel) FreemarkerModel.get()).findTypeDefinition(classDeclaration));
      refQName = new QName(refElement.getNamespace(), refElement.getName());
    }

    if (refQName == null) {
View Full Code Here

   *
   * @return The element for the XML representation, if any.
   */
  public ElementDeclaration getXmlElement() {
    if (delegate instanceof ClassType) {
      ClassDeclaration declaration = ((ClassType) delegate).getDeclaration();
      if (declaration != null) {
        return ((EnunciateFreemarkerModel) FreemarkerModel.get()).findElementDeclaration(declaration);
      }
    }
    return null;
View Full Code Here

   *
   * @return The type for the JSON representation, if any.
   */
  public JsonType getJsonType() {
    if (delegate instanceof ClassType) {
      ClassDeclaration declaration = ((ClassType) delegate).getDeclaration();
      if (declaration != null) {
        return ((EnunciateFreemarkerModel) FreemarkerModel.get()).findJsonTypeDefinition(declaration);
      }
    }
    return null;
View Full Code Here

   *
   * @return The XML element associated with the entity parameter, or null if none (or unknown).
   */
  public ElementDeclaration getXmlElement() {
    if (this.type instanceof ClassType) {
      ClassDeclaration declaration = ((ClassType) this.type).getDeclaration();
      if (declaration != null) {
        return ((EnunciateFreemarkerModel) FreemarkerModel.get()).findElementDeclaration(declaration);
      }
    }
    return null;
View Full Code Here

   *
   * @return The JSON element associated with the entity parameter, or null if none (or unknown).
   */
  public JsonType getJsonType() {
    if (this.type instanceof ClassType) {
      ClassDeclaration declaration = ((ClassType) this.type).getDeclaration();
      if (declaration != null) {
        return ((EnunciateFreemarkerModel) FreemarkerModel.get()).findJsonTypeDefinition(declaration);
      }
    }
    return null;
View Full Code Here

    Object unwrapped = BeansWrapper.getDefaultInstance().unwrap(from);
    if (!(unwrapped instanceof ClassDeclaration)) {
      throw new TemplateModelException("A class declaration must be provided.");
    }

    ClassDeclaration def = (ClassDeclaration) unwrapped;
    EnunciateFreemarkerModel model = (EnunciateFreemarkerModel) FreemarkerModel.get();
    return model.findElementDeclaration(def);
  }
View Full Code Here

TOP

Related Classes of com.sun.mirror.declaration.ClassDeclaration

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.