public final List<ParameterDeclaration> createParameters(final Iterable<ParameterDefinition> parameters) { final List<ParameterDeclaration> declarations = new ArrayList<>(); for (final ParameterDefinition p : parameters) { final TypeReference type = p.getParameterType(); final AstType astType = convertType(type); final ParameterDeclaration d = new ParameterDeclaration(p.getName(), astType); d.putUserData(Keys.PARAMETER_DEFINITION, p); for (final CustomAnnotation annotation : p.getAnnotations()) { d.getAnnotations().add(createAnnotation(annotation)); } declarations.add(d); if (p.isFinal()) { EntityDeclaration.addModifier(d, Modifier.FINAL); } } return Collections.unmodifiableList(declarations); }
return createAnnotation(((AnnotationAnnotationElement) element).getAnnotation());
return createAnnotation(((AnnotationAnnotationElement) element).getAnnotation());
public final List<ParameterDeclaration> createParameters(final Iterable<ParameterDefinition> parameters) { final List<ParameterDeclaration> declarations = new ArrayList<>(); for (final ParameterDefinition p : parameters) { final TypeReference type = p.getParameterType(); final AstType astType = convertType(type); final ParameterDeclaration d = new ParameterDeclaration(p.getName(), astType); d.putUserData(Keys.PARAMETER_DEFINITION, p); for (final CustomAnnotation annotation : p.getAnnotations()) { d.getAnnotations().add(createAnnotation(annotation)); } declarations.add(d); if (p.isFinal()) { EntityDeclaration.addModifier(d, Modifier.FINAL); } } return Collections.unmodifiableList(declarations); }
return createAnnotation(((AnnotationAnnotationElement) element).getAnnotation());
public final List<ParameterDeclaration> createParameters(final Iterable<ParameterDefinition> parameters) { final List<ParameterDeclaration> declarations = new ArrayList<>(); for (final ParameterDefinition p : parameters) { final TypeReference type = p.getParameterType(); final AstType astType = convertType(type); final ParameterDeclaration d = new ParameterDeclaration(p.getName(), astType); d.putUserData(Keys.PARAMETER_DEFINITION, p); for (final CustomAnnotation annotation : p.getAnnotations()) { d.getAnnotations().add(createAnnotation(annotation)); } declarations.add(d); if (p.isFinal()) { EntityDeclaration.addModifier(d, Modifier.FINAL); } } return Collections.unmodifiableList(declarations); }
astMethod.getAnnotations().add(createAnnotation(annotation));
astType.getAnnotations().add(createAnnotation(annotation));
astMethod.getAnnotations().add(createAnnotation(annotation));
astType.getAnnotations().add(createAnnotation(annotation));
astMethod.getAnnotations().add(createAnnotation(annotation));
astType.getAnnotations().add(createAnnotation(annotation));
private FieldDeclaration createField(final FieldDefinition field) { final FieldDeclaration astField = new FieldDeclaration(); final VariableInitializer initializer = new VariableInitializer(field.getName()); astField.setName(field.getName()); astField.addChild(initializer, Roles.VARIABLE); astField.setReturnType(convertType(field.getFieldType())); astField.putUserData(Keys.FIELD_DEFINITION, field); astField.putUserData(Keys.MEMBER_REFERENCE, field); EntityDeclaration.setModifiers( astField, Flags.asModifierSet(scrubAccessModifiers(field.getFlags() & Flags.VarFlags)) ); if (field.hasConstantValue()) { initializer.setInitializer(new PrimitiveExpression(Expression.MYSTERY_OFFSET, field.getConstantValue())); initializer.putUserData(Keys.FIELD_DEFINITION, field); initializer.putUserData(Keys.MEMBER_REFERENCE, field); } for (final CustomAnnotation annotation : field.getAnnotations()) { astField.getAnnotations().add(createAnnotation(annotation)); } return astField; }
private FieldDeclaration createField(final FieldDefinition field) { final FieldDeclaration astField = new FieldDeclaration(); final VariableInitializer initializer = new VariableInitializer(field.getName()); astField.setName(field.getName()); astField.addChild(initializer, Roles.VARIABLE); astField.setReturnType(convertType(field.getFieldType())); astField.putUserData(Keys.FIELD_DEFINITION, field); astField.putUserData(Keys.MEMBER_REFERENCE, field); EntityDeclaration.setModifiers( astField, Flags.asModifierSet(scrubAccessModifiers(field.getFlags() & Flags.VarFlags)) ); if (field.hasConstantValue()) { initializer.setInitializer(new PrimitiveExpression(Expression.MYSTERY_OFFSET, field.getConstantValue())); initializer.putUserData(Keys.FIELD_DEFINITION, field); initializer.putUserData(Keys.MEMBER_REFERENCE, field); } for (final CustomAnnotation annotation : field.getAnnotations()) { astField.getAnnotations().add(createAnnotation(annotation)); } return astField; }
private FieldDeclaration createField(final FieldDefinition field) { final FieldDeclaration astField = new FieldDeclaration(); final VariableInitializer initializer = new VariableInitializer(field.getName()); astField.setName(field.getName()); astField.addChild(initializer, Roles.VARIABLE); astField.setReturnType(convertType(field.getFieldType())); astField.putUserData(Keys.FIELD_DEFINITION, field); astField.putUserData(Keys.MEMBER_REFERENCE, field); EntityDeclaration.setModifiers( astField, Flags.asModifierSet(scrubAccessModifiers(field.getFlags() & Flags.VarFlags)) ); if (field.hasConstantValue()) { initializer.setInitializer(new PrimitiveExpression(Expression.MYSTERY_OFFSET, field.getConstantValue())); initializer.putUserData(Keys.FIELD_DEFINITION, field); initializer.putUserData(Keys.MEMBER_REFERENCE, field); } for (final CustomAnnotation annotation : field.getAnnotations()) { astField.getAnnotations().add(createAnnotation(annotation)); } return astField; }
private ConstructorDeclaration createConstructor(final MethodDefinition method) { final ConstructorDeclaration astMethod = new ConstructorDeclaration(); EntityDeclaration.setModifiers( astMethod, Flags.asModifierSet(scrubAccessModifiers(method.getFlags() & Flags.ConstructorFlags)) ); astMethod.setName(method.getDeclaringType().getName()); astMethod.getParameters().addAll(createParameters(method.getParameters())); astMethod.getTypeParameters().addAll(createTypeParameters(method.getGenericParameters())); astMethod.setBody(createMethodBody(method, astMethod.getParameters())); astMethod.putUserData(Keys.METHOD_DEFINITION, method); astMethod.putUserData(Keys.MEMBER_REFERENCE, method); for (final CustomAnnotation annotation : method.getAnnotations()) { astMethod.getAnnotations().add(createAnnotation(annotation)); } for (final TypeReference thrownType : method.getThrownTypes()) { astMethod.addChild(convertType(thrownType), Roles.THROWN_TYPE); } return astMethod; }
d.getAnnotations().add(_astBuilder.createAnnotation(annotation));
d.getAnnotations().add(_astBuilder.createAnnotation(annotation));
d.getAnnotations().add(_astBuilder.createAnnotation(annotation));