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