Package org.springframework.roo.classpath.details

Examples of org.springframework.roo.classpath.details.ConstructorMetadata


     *
     * @return <code>null</code> if no constructor is to be produced
     */
    private ConstructorMetadataBuilder getNoArgConstructor() {
        // Search for an existing constructor
        final ConstructorMetadata existingExplicitConstructor = governorTypeDetails
                .getDeclaredConstructor(null);
        if (existingExplicitConstructor != null) {
            // Found an existing no-arg constructor on this class, so return it
            return new ConstructorMetadataBuilder(existingExplicitConstructor);
        }
View Full Code Here


                    cidBuilder.addMethod(method);
                }
                if (member instanceof ConstructorDeclaration) {
                    final ConstructorDeclaration castMember = (ConstructorDeclaration) member;
                    final ConstructorMetadata constructor = JavaParserConstructorMetadataBuilder
                            .getInstance(declaredByMetadataId, castMember,
                                    compilationUnitServices, typeParameterNames)
                            .build();

                    final CommentStructure commentStructure = new CommentStructure();
                    JavaParserCommentMetadataBuilder.updateCommentsToRoo(
                            commentStructure, member);
                    constructor.setCommentStructure(commentStructure);

                    cidBuilder.addConstructor(constructor);
                }
                if (member instanceof TypeDeclaration) {
                    final TypeDeclaration castMember = (TypeDeclaration) member;
View Full Code Here

                // Next constructor should appear after this current constructor
                final ConstructorDeclaration cd = (ConstructorDeclaration) bd;
                if (cd.getParameters().size() == d.getParameters().size()) {
                    // Possible match, we need to consider parameter types as
                    // well now
                    final ConstructorMetadata constructorMetadata = new JavaParserConstructorMetadataBuilder(
                            constructor.getDeclaredByMetadataId(), cd,
                            compilationUnitServices, typeParameters).build();
                    boolean matchesFully = true;
                    for (final AnnotatedJavaType existingParameter : constructorMetadata
                            .getParameterTypes()) {
                        if (!existingParameter.getJavaType().equals(
                                constructor.getParameterTypes().get(index))) {
                            matchesFully = false;
                            break;
View Full Code Here

        final List<JavaType> parameterTypes = new ArrayList<JavaType>();
        for (final FieldMetadata fieldMetadata : constructorFields) {
            parameterTypes.add(fieldMetadata.getFieldType());
        }

        final ConstructorMetadata result = javaTypeDetails
                .getDeclaredConstructor(parameterTypes);
        if (result != null) {
            // Found an existing constructor on this class
            return;
        }
View Full Code Here

                            .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);
                }
View Full Code Here

     *         produced)
     */
    private ConstructorMetadataBuilder getNoArgConstructor() {
        // Search for an existing constructor
        final List<JavaType> parameterTypes = new ArrayList<JavaType>();
        final ConstructorMetadata result = governorTypeDetails
                .getDeclaredConstructor(parameterTypes);
        if (result != null) {
            // Found an existing no-arg constructor on this class
            return null;
        }
View Full Code Here

        final List<JavaType> parameterTypes = new ArrayList<JavaType>();
        for (final FieldMetadataBuilder field : fields) {
            parameterTypes.add(field.getFieldType());
        }

        final ConstructorMetadata result = governorTypeDetails
                .getDeclaredConstructor(parameterTypes);
        if (result != null) {
            // Found an existing parameterised constructor on this class
            publicNoArgConstructor = true;
            return null;
View Full Code Here

                // Next constructor should appear after this current constructor
                final ConstructorDeclaration cd = (ConstructorDeclaration) bd;
                if (cd.getParameters().size() == d.getParameters().size()) {
                    // Possible match, we need to consider parameter types as
                    // well now
                    final ConstructorMetadata constructorMetadata = new JavaParserConstructorMetadataBuilder(
                            constructor.getDeclaredByMetadataId(), cd,
                            compilationUnitServices, typeParameters).build();
                    boolean matchesFully = true;
                    for (final AnnotatedJavaType existingParameter : constructorMetadata
                            .getParameterTypes()) {
                        if (!existingParameter.getJavaType().equals(
                                constructor.getParameterTypes().get(index))) {
                            matchesFully = false;
                            break;
View Full Code Here

    private void doModification(final ConstructorMetadata constructor,
            final CustomData customData) {
        final MemberHoldingTypeDetails memberHoldingTypeDetails = memberHoldingTypeDetailsMap
                .get(constructor.getDeclaredByMetadataId());
        if (memberHoldingTypeDetails != null) {
            final ConstructorMetadata matchedConstructor = memberHoldingTypeDetails
                    .getDeclaredConstructor(AnnotatedJavaType
                            .convertFromAnnotatedJavaTypes(constructor
                                    .getParameterTypes()));
            if (matchedConstructor != null
                    && !matchedConstructor.getCustomData().keySet()
                            .containsAll(customData.keySet())) {
                final TypeDetailsBuilder typeDetailsBuilder = getTypeDetailsBuilder(memberHoldingTypeDetails);
                typeDetailsBuilder
                        .addDataToConstructor(constructor, customData);
                changed = true;
View Full Code Here

    builder.append("itdTypeDetails", itdTypeDetails);
    return builder.toString();
  }

  private ConstructorMetadataBuilder getConstructor() {
    final ConstructorMetadata constructor = governorTypeDetails
        .getDeclaredConstructor(Arrays.asList(CONVERSION_SERVICE));
    if (constructor != null) {
      return null;
    }
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.details.ConstructorMetadata

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.