use of com.emc.apidocs.model.ApiClass in project coprhd-controller by CoprHD.
the class EnunciateFileReader method toApiClass.
private ApiClass toApiClass(Node typeNode) {
ApiClass apiClass = new ApiClass();
apiClass.name = XMLUtils.getNodeText(typeNode, EnunciateConstants.TYPE_NAME);
NodeList elementList = XMLUtils.getNodeList(typeNode, EnunciateConstants.TYPE_ELEMENT);
for (int f = 0; f < elementList.getLength(); f++) {
Node element = elementList.item(f);
apiClass.addField(toApiField(element));
}
NodeList attributeList = XMLUtils.getNodeList(typeNode, EnunciateConstants.TYPE_ATTRIBUTE);
for (int f = 0; f < attributeList.getLength(); f++) {
Node attribute = attributeList.item(f);
String attributeType = XMLUtils.getNodeText(attribute, EnunciateConstants.ATTRIBUTE_TYPE);
String attributeName = XMLUtils.getNodeText(attribute, EnunciateConstants.ATTRIBUTE_NAME);
ApiField attributeField = new ApiField();
attributeField.name = attributeName;
attributeField.primitiveType = attributeType;
apiClass.addAttribute(attributeField);
}
return apiClass;
}
Aggregations