Package org.jboss.dna.sequencer.java.metadata

Examples of org.jboss.dna.sequencer.java.metadata.ConstructorMetadata


     *
     * @param methodDeclaration
     * @return constructorMetadata
     */
    protected MethodMetadata getConstructorMetadataFrom( MethodDeclaration methodDeclaration ) {
        ConstructorMetadata constructorMetadata = new ConstructorMetadata();
        // modifiers
        processModifiersOfMethodDeclaration(methodDeclaration, constructorMetadata);
        processParametersOfMethodDeclaration(methodDeclaration, constructorMetadata);
        constructorMetadata.setName(JavaMetadataUtil.getName(methodDeclaration.getName()));
        // arguments list
        return constructorMetadata;
    }
View Full Code Here


                    int methodIndex = 1;
                    int constructorIndex = 1;
                    for (MethodMetadata methodMetadata : methods) {
                        if (methodMetadata.isContructor()) {
                            // process constructor
                            ConstructorMetadata constructorMetadata = (ConstructorMetadata)methodMetadata;
                            String constructorRootPath = JavaMetadataUtil.createPathWithIndex(JAVA_COMPILATION_UNIT_NODE
                                                                                              + SLASH
                                                                                              + JAVA_UNIT_TYPE_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_CLASS_DECLARATION_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_NORMAL_CLASS_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_NORMAL_CLASS_DECLARATION_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_CONSTRUCTOR_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_CONSTRUCTOR_DECLARATION_CHILD_NODE,
                                                                                              constructorIndex);
                            Path constructorChildNode = pathFactory.create(constructorRootPath);
                            output.setProperty(constructorChildNode,
                                               nameFactory.create(JAVA_CONSTRUCTOR_NAME),
                                               constructorMetadata.getName());
                            List<ModifierMetadata> modifiers = constructorMetadata.getModifiers();
                            // modifiers
                            int constructorModifierIndex = 1;
                            for (ModifierMetadata modifierMetadata : modifiers) {
                                String contructorModifierPath = JavaMetadataUtil.createPathWithIndex(constructorRootPath
                                                                                                     + SLASH
                                                                                                     + JAVA_MODIFIER_CHILD_NODE
                                                                                                     + SLASH
                                                                                                     + JAVA_MODIFIER_DECLARATION_CHILD_NODE,
                                                                                                     constructorModifierIndex);

                                Path constructorModifierChildNode = pathFactory.create(contructorModifierPath);
                                output.setProperty(constructorModifierChildNode,
                                                   nameFactory.create(JAVA_MODIFIER_NAME),
                                                   modifierMetadata.getName());
                                constructorModifierIndex++;
                            }

                            // constructor parameters
                            int constructorParameterIndex = 1;
                            for (FieldMetadata fieldMetadata : constructorMetadata.getParameters()) {

                                String constructorParameterRootPath = JavaMetadataUtil.createPathWithIndex(constructorRootPath
                                                                                                           + SLASH
                                                                                                           + JAVA_PARAMETER
                                                                                                           + SLASH
View Full Code Here

                    int methodIndex = 1;
                    int constructorIndex = 1;
                    for (MethodMetadata methodMetadata : methods) {
                        if (methodMetadata.isContructor()) {
                            // process constructor
                            ConstructorMetadata constructorMetadata = (ConstructorMetadata)methodMetadata;
                            String constructorRootPath = JavaMetadataUtil.createPathWithIndex(JAVA_COMPILATION_UNIT_NODE
                                                                                              + SLASH
                                                                                              + JAVA_UNIT_TYPE_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_CLASS_DECLARATION_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_NORMAL_CLASS_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_NORMAL_CLASS_DECLARATION_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_CONSTRUCTOR_CHILD_NODE
                                                                                              + SLASH
                                                                                              + JAVA_CONSTRUCTOR_DECLARATION_CHILD_NODE,
                                                                                              constructorIndex);
                            Path constructorChildNode = pathFactory.create(constructorRootPath);
                            output.setProperty(constructorChildNode,
                                               nameFactory.create(JAVA_CONSTRUCTOR_NAME),
                                               constructorMetadata.getName());
                            List<ModifierMetadata> modifiers = constructorMetadata.getModifiers();
                            // modifiers
                            int constructorModifierIndex = 1;
                            for (ModifierMetadata modifierMetadata : modifiers) {
                                String contructorModifierPath = JavaMetadataUtil.createPathWithIndex(constructorRootPath
                                                                                                     + SLASH
                                                                                                     + JAVA_MODIFIER_CHILD_NODE
                                                                                                     + SLASH
                                                                                                     + JAVA_MODIFIER_DECLARATION_CHILD_NODE,
                                                                                                     constructorModifierIndex);

                                Path constructorModifierChildNode = pathFactory.create(contructorModifierPath);
                                output.setProperty(constructorModifierChildNode,
                                                   nameFactory.create(JAVA_MODIFIER_NAME),
                                                   modifierMetadata.getName());
                                constructorModifierIndex++;
                            }

                            // constructor parameters
                            int constructorParameterIndex = 1;
                            for (FieldMetadata fieldMetadata : constructorMetadata.getParameters()) {

                                String constructorParameterRootPath = JavaMetadataUtil.createPathWithIndex(constructorRootPath
                                                                                                           + SLASH
                                                                                                           + JAVA_PARAMETER
                                                                                                           + SLASH
View Full Code Here

     *
     * @param methodDeclaration
     * @return constructorMetadata
     */
    protected MethodMetadata getConstructorMetadataFrom( MethodDeclaration methodDeclaration ) {
        ConstructorMetadata constructorMetadata = new ConstructorMetadata();
        // modifiers
        processModifiersOfMethodDeclaration(methodDeclaration, constructorMetadata);
        processParametersOfMethodDeclaration(methodDeclaration, constructorMetadata);
        constructorMetadata.setName(JavaMetadataUtil.getName(methodDeclaration.getName()));
        // arguments list
        return constructorMetadata;
    }
View Full Code Here

                List<MethodMetadata> methods = classMetadata.getMethods();
                assertNotNull(methods);
                assertTrue(methods.size() > 0);

                MethodMetadata methodMetadata = methods.get(0);
                ConstructorMetadata constructorMetadata = (ConstructorMetadata)methodMetadata;
                assertNotNull(constructorMetadata);
                assertTrue(constructorMetadata.getModifiers().size() == 0);
                assertThat(constructorMetadata.getName(), is("MySource"));
                assertTrue(constructorMetadata.getParameters().size() == 0);

                MethodMetadata methodMetadata2 = methods.get(1);
                ConstructorMetadata constructorMetadata2 = (ConstructorMetadata)methodMetadata2;
                assertNotNull(constructorMetadata2);
                assertTrue(constructorMetadata2.getModifiers().size() == 1);
                assertThat(constructorMetadata2.getName(), is("MySource"));
                assertTrue(constructorMetadata2.getParameters().size() > 0);

                MethodTypeMemberMetadata methodTypeMemberMetadata1 = (MethodTypeMemberMetadata)methods.get(2);
                assertTrue(methodTypeMemberMetadata1.getModifiers().size() == 1);
                assertEquals(methodTypeMemberMetadata1.getReturnType().getType(), "int");
                assertNotNull(methodTypeMemberMetadata1);
View Full Code Here

TOP

Related Classes of org.jboss.dna.sequencer.java.metadata.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.