Examples of FieldDeclaration


Examples of japa.parser.ast.body.FieldDeclaration

                }
            }

            for (final BodyDeclaration member : members) {
                if (member instanceof FieldDeclaration) {
                    final FieldDeclaration castMember = (FieldDeclaration) member;
                    for (final VariableDeclarator var : castMember
                            .getVariables()) {
                        final FieldMetadata field = JavaParserFieldMetadataBuilder
                                .getInstance(declaredByMetadataId, castMember,
                                        var, compilationUnitServices,
                                        typeParameterNames).build();
                        cidBuilder.addField(field);
                    }
                }
                if (member instanceof MethodDeclaration) {
                    final MethodDeclaration castMember = (MethodDeclaration) member;
                    final MethodMetadata method = JavaParserMethodMetadataBuilder
                            .getInstance(declaredByMetadataId, castMember,
                                    compilationUnitServices, typeParameterNames)
                            .build();
                    cidBuilder.addMethod(method);
                }
                if (member instanceof ConstructorDeclaration) {
                    final ConstructorDeclaration castMember = (ConstructorDeclaration) member;
                    final ConstructorMetadata constructor = JavaParserConstructorMetadataBuilder
                            .getInstance(declaredByMetadataId, castMember,
                                    compilationUnitServices, typeParameterNames)
                            .build();
                    cidBuilder.addConstructor(constructor);
                }
                if (member instanceof TypeDeclaration) {
                    final TypeDeclaration castMember = (TypeDeclaration) member;
                    final JavaType innerType = new JavaType(
                            castMember.getName(), name);
                    final String innerTypeMetadataId = PhysicalTypeIdentifier
                            .createIdentifier(innerType, PhysicalTypeIdentifier
                                    .getPath(declaredByMetadataId));
                    final ClassOrInterfaceTypeDetails cid = new JavaParserClassOrInterfaceTypeDetailsBuilder(
                            compilationUnit, compilationUnitServices,
View Full Code Here

Examples of org.activiti.engine.impl.bpmn.parser.FieldDeclaration

 
  public List<FieldDeclaration> createFieldDeclarations(List<FieldExtension> fieldList) {
    List<FieldDeclaration> fieldDeclarations = new ArrayList<FieldDeclaration>();

    for (FieldExtension fieldExtension : fieldList) {
      FieldDeclaration fieldDeclaration = null;
      if (StringUtils.isNotEmpty(fieldExtension.getExpression())) {
        fieldDeclaration = new FieldDeclaration(fieldExtension.getFieldName(), Expression.class.getName(),
            expressionManager.createExpression(fieldExtension.getExpression()));
      } else {
        fieldDeclaration = new FieldDeclaration(fieldExtension.getFieldName(), Expression.class.getName(),
            new FixedValue(fieldExtension.getStringValue()));
      }
     
      fieldDeclarations.add(fieldDeclaration);
    }
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.declaration.FieldDeclaration

       
        if ( fields.size() > 0 )
        {
            for ( Iterator i = fields.iterator(); i.hasNext(); )
            {
                FieldDeclaration field = ( FieldDeclaration ) i.next();
                AnnotationInstance fieldAnnotation =
                        CompilerUtils.getAnnotation( field, JpfLanguageConstants.SHARED_FLOW_FIELD_TAG_NAME );
               
                if ( fieldAnnotation == null )
                {
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.declaration.FieldDeclaration

        //
        DeclaredType outputFormType = CompilerUtils.getDeclaredType( annotation, OUTPUT_FORM_BEAN_TYPE_ATTR, true );
        String outputFormMember = CompilerUtils.getString( annotation, OUTPUT_FORM_BEAN_ATTR, true );
        if ( outputFormMember != null )
        {
            FieldDeclaration field = CompilerUtils.getClassField( jclass, outputFormMember, null );
            assert outputFormType == null// checker should catch this
            assert field != null;           // checker should catch this
            assert field.getType() instanceof DeclaredType : field.getType().getClass().getName(); // checker enforces
            outputFormType = ( DeclaredType ) field.getType();
        }
        setOutputFormBeanMember( outputFormMember );
        setOutputFormBeanType( outputFormType != null ? CompilerUtils.getLoadableName( outputFormType ) : null );
       
        //
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.declaration.FieldDeclaration

        //
        Collection fields = CompilerUtils.getClassFields( jclass );
       
        for ( Iterator ii = fields.iterator(); ii.hasNext();
        {
            FieldDeclaration field = ( FieldDeclaration ) ii.next();
            checkField( field, jclass );
        }

        //
        // Check the methods.  Note that we're checking public and protected inherited methods, too.
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration

      contents[contentsOffset++] = (byte) (signatureIndex >> 8);
      contents[contentsOffset++] = (byte) signatureIndex;
      attributesNumber++;
    }
    if (this.targetJDK >= ClassFileConstants.JDK1_5 && !this.creatingProblemType) {
      FieldDeclaration fieldDeclaration = fieldBinding.sourceField();
      if (fieldDeclaration != null) {
        Annotation[] annotations = fieldDeclaration.annotations;
        if (annotations != null) {
          attributesNumber += generateRuntimeAnnotations(annotations);
        }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration

    contents[contentsOffset++] = (byte) (fieldCount >> 8);
    contents[contentsOffset++] = (byte) fieldCount;

    FieldDeclaration[] fieldDecls = currentBinding.scope.referenceContext.fields;
    for (int i = 0, max = fieldDecls == null ? 0 : fieldDecls.length; i < max; i++) {
      FieldDeclaration fieldDecl = fieldDecls[i];
      if (fieldDecl.binding != null) {
        addFieldInfo(fieldDecl.binding);
      }
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration

  private ASTNode[] computeMergedMemberDeclarations(ASTNode[] nodes){
    ArrayList mergedNodes = new ArrayList();
    for (int i = 0, max = nodes.length; i < max; i++) {
      ASTNode currentNode = nodes[i];
      if (currentNode instanceof FieldDeclaration) {
        FieldDeclaration currentField = (FieldDeclaration) currentNode;
        if (mergedNodes.size() == 0) {
          // first node
          mergedNodes.add(currentNode);
        } else {
          // we need to check if the previous merged node is a field declaration
          ASTNode previousMergedNode = (ASTNode) mergedNodes.get(mergedNodes.size() - 1);
          if (previousMergedNode instanceof MultiFieldDeclaration) {
            // we merge the current node
            MultiFieldDeclaration multiFieldDeclaration = (MultiFieldDeclaration) previousMergedNode;
            int length = multiFieldDeclaration.declarations.length;
            System.arraycopy(multiFieldDeclaration.declarations, 0, multiFieldDeclaration.declarations= new FieldDeclaration[length+1], 0, length);
            multiFieldDeclaration.declarations[length] = currentField;
          } else if (previousMergedNode instanceof FieldDeclaration) {
            // need to check we need to create a multiple field declaration
            final FieldDeclaration previousFieldDeclaration = (FieldDeclaration)previousMergedNode;
            if (currentField.declarationSourceStart == previousFieldDeclaration.declarationSourceStart) {
              // we create a multi field declaration
              final MultiFieldDeclaration multiFieldDeclaration = new MultiFieldDeclaration(new FieldDeclaration[]{ previousFieldDeclaration, currentField});
              multiFieldDeclaration.annotations = previousFieldDeclaration.annotations;
              mergedNodes.set(mergedNodes.size() - 1, multiFieldDeclaration);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration

  }
 
  private ASTNode[] computeMergedMemberDeclarations(TypeDeclaration typeDeclaration){
   
    int fieldIndex = 0, fieldCount = (typeDeclaration.fields == null) ? 0 : typeDeclaration.fields.length;
    FieldDeclaration field = fieldCount == 0 ? null : typeDeclaration.fields[fieldIndex];
    int fieldStart = field == null ? Integer.MAX_VALUE : field.declarationSourceStart;

    int methodIndex = 0, methodCount = (typeDeclaration.methods == null) ? 0 : typeDeclaration.methods.length;
    AbstractMethodDeclaration method = methodCount == 0 ? null : typeDeclaration.methods[methodIndex];
    int methodStart = method == null ? Integer.MAX_VALUE : method.declarationSourceStart;

    int typeIndex = 0, typeCount = (typeDeclaration.memberTypes == null) ? 0 : typeDeclaration.memberTypes.length;
    TypeDeclaration type = typeCount == 0 ? null : typeDeclaration.memberTypes[typeIndex];
    int typeStart = type == null ? Integer.MAX_VALUE : type.declarationSourceStart;
 
    final int memberLength = fieldCount+methodCount+typeCount;
    ASTNode[] members = new ASTNode[memberLength];
    if (memberLength != 0) {
      int index = 0;
      int previousFieldStart = -1;
      do {
        if (fieldStart < methodStart && fieldStart < typeStart) {
          if (field.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
            // filter out enum constants
            previousFieldStart = fieldStart;
            if (++fieldIndex < fieldCount) { // find next field if any
              fieldStart = (field = typeDeclaration.fields[fieldIndex]).declarationSourceStart;
            } else {
              fieldStart = Integer.MAX_VALUE;
            }
            continue;
          }
          // next member is a field
          if (fieldStart == previousFieldStart){
            ASTNode previousMember = members[index - 1];
            if (previousMember instanceof MultiFieldDeclaration) {
              MultiFieldDeclaration multiField = (MultiFieldDeclaration) previousMember;
              int length = multiField.declarations.length;
              System.arraycopy(multiField.declarations, 0, multiField.declarations=new FieldDeclaration[length+1], 0, length);
              multiField.declarations[length] = field;
            } else {
              FieldDeclaration fieldDeclaration = (FieldDeclaration)previousMember;
              final MultiFieldDeclaration multiFieldDeclaration = new MultiFieldDeclaration(new FieldDeclaration[]{ fieldDeclaration, field});
              multiFieldDeclaration.annotations = fieldDeclaration.annotations;
              members[index - 1] = multiFieldDeclaration;
            }
          } else {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration

 
    boolean ok = false;
    do {
      try {
        for (int i = 0, length = multipleFieldDeclarationsLength; i < length; i++) {
          FieldDeclaration fieldDeclaration = multiFieldDeclaration.declarations[i];
          /*
           * Field name
           */
          if (i == 0) {
            this.scribe.alignFragment(fieldAlignment, 0);
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.