Example usage for org.eclipse.jdt.core.dom AnnotationTypeMemberDeclaration setType

List of usage examples for org.eclipse.jdt.core.dom AnnotationTypeMemberDeclaration setType

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom AnnotationTypeMemberDeclaration setType.

Prototype

public void setType(Type type) 

Source Link

Document

Sets the type of the annotation type member declared in this declaration to the given type.

Usage

From source file:com.crispico.flower.mp.codesync.code.java.adapter.JavaAnnotationTypeMemberDeclarationModelAdapter.java

License:Open Source License

@Override
public void setValueFeatureValue(Object element, Object feature, Object value) {
    if (CodeSyncPackage.eINSTANCE.getCodeSyncElement_Name().equals(feature)) {
        AnnotationTypeMemberDeclaration member = getAnnotationMember(element);
        member.setName(member.getAST().newSimpleName((String) value));
    }/*  ww w .java  2 s. c  om*/
    if (AstCacheCodePackage.eINSTANCE.getAnnotationMember_DefaultValue().equals(feature)) {
        AnnotationTypeMemberDeclaration member = getAnnotationMember(element);
        member.setDefault(getExpressionFromString(member.getAST(), (String) value));
    }
    if (AstCacheCodePackage.eINSTANCE.getTypedElement_Type().equals(feature)) {
        AnnotationTypeMemberDeclaration member = getAnnotationMember(element);
        member.setType(getTypeFromString(member.getAST(), (String) value));
    }
    super.setValueFeatureValue(element, feature, value);
}

From source file:java5totext.input.JDTVisitor.java

License:Open Source License

@Override
public void endVisit(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration node) {
    AnnotationTypeMemberDeclaration element = (AnnotationTypeMemberDeclaration) this.binding.get(node);
    this.initializeNode(element, node);
    element.setName(node.getName().getIdentifier());
    endVisitBD(node, element);//from   w w w  .ja va2 s .  com
    if (this.binding.get(node.getType()) != null)
        element.setType((NamedElementRef) this.binding.get(node.getType()));
    if (this.binding.get(node.getDefault()) != null)
        element.setDefault((Expression) this.binding.get(node.getDefault()));
    JDTVisitorUtils.manageBindingDeclaration(element, node.getName(), this);
}

From source file:org.eclipse.jdt.core.dom.ASTConverter.java

License:Open Source License

protected void setTypeForMethodDeclaration(AnnotationTypeMemberDeclaration annotationTypeMemberDeclaration,
        Type type, int extraDimension) {
    annotationTypeMemberDeclaration.setType(type);
}

From source file:org.eclipse.modisco.java.discoverer.internal.io.java.JDTVisitor.java

License:Open Source License

@Override
public void endVisit(final org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration node) {
    AnnotationTypeMemberDeclaration element = (AnnotationTypeMemberDeclaration) this.binding.get(node);
    initializeNode(element, node);/*from   ww  w.ja  v  a2  s  . c  om*/

    element.setName(node.getName().getIdentifier());

    if (this.binding.get(node.getType()) != null) {
        element.setType(JDTVisitorUtils.completeTypeAccess(this.binding.get(node.getType()), this));
    }

    if (this.binding.get(node.getDefault()) != null) {
        element.setDefault(JDTVisitorUtils.completeExpression(this.binding.get(node.getDefault()), this));
    }

    endVisitBD(node, element);
    JDTVisitorUtils.manageBindingDeclaration(element, node.getName(), this);
}

From source file:org.flowerplatform.codesync.code.java.adapter.JavaAnnotationTypeMemberDeclarationModelAdapter.java

License:Open Source License

@Override
public void setValueFeatureValue(Object element, Object feature, Object value) {
    if (CoreConstants.NAME.equals(feature)) {
        AnnotationTypeMemberDeclaration member = getAnnotationMember(element);
        member.setName(member.getAST().newSimpleName((String) value));
    } else if (CodeSyncCodeJavaConstants.ANNOTATION_MEMBER_DEFAULT_VALUE.equals(feature)) {
        AnnotationTypeMemberDeclaration member = getAnnotationMember(element);
        member.setDefault(getExpressionFromString(member.getAST(), (String) value));
    } else if (CodeSyncCodeJavaConstants.TYPED_ELEMENT_TYPE.equals(feature)) {
        AnnotationTypeMemberDeclaration member = getAnnotationMember(element);
        member.setType(getTypeFromString(member.getAST(), (String) value));
    }//from w w w.j a  v  a2  s  .  c o m
    super.setValueFeatureValue(element, feature, value);
}

From source file:org.whole.lang.java.util.JDTTransformerVisitor.java

License:Open Source License

public boolean visit(AnnotationTypeMemberDeclaration node) {
    org.whole.lang.java.model.AnnotationTypeMemberDeclaration annotationTypeMemberDeclaration;
    appendBodyDeclaration(annotationTypeMemberDeclaration = lf
            .create(JavaEntityDescriptorEnum.AnnotationTypeMemberDeclaration));

    if (acceptChild(node.getJavadoc()))
        annotationTypeMemberDeclaration.setJavadoc(this.javadoc);

    List<?> modifiers = node.modifiers();
    if (!modifiers.isEmpty()) {
        annotationTypeMemberDeclaration.setModifiers(lf.create(JavaEntityDescriptorEnum.ExtendedModifiers));
        setExtendedModifiers(annotationTypeMemberDeclaration.getModifiers(), modifiers);
    }//  w ww.j  a  v a 2  s  .  c  o  m

    acceptChild(node.getName());
    annotationTypeMemberDeclaration.setName((org.whole.lang.java.model.SimpleName) this.name);

    acceptChild(node.getType());
    annotationTypeMemberDeclaration.setType(this.type);

    if (acceptChild(node.getDefault()))
        annotationTypeMemberDeclaration.setDefault(this.exp);

    return false;
}