Search in sources :

Example 6 with ApiClass

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;
}
Also used : NodeList(org.w3c.dom.NodeList) Node(org.w3c.dom.Node) ApiClass(com.emc.apidocs.model.ApiClass) ApiField(com.emc.apidocs.model.ApiField)

Aggregations

ApiClass (com.emc.apidocs.model.ApiClass)6 Node (org.w3c.dom.Node)4 ApiField (com.emc.apidocs.model.ApiField)3 NodeList (org.w3c.dom.NodeList)3 ApiMethod (com.emc.apidocs.model.ApiMethod)1 ApiService (com.emc.apidocs.model.ApiService)1 ClassDoc (com.sun.javadoc.ClassDoc)1 FieldDoc (com.sun.javadoc.FieldDoc)1 MemberDoc (com.sun.javadoc.MemberDoc)1 MethodDoc (com.sun.javadoc.MethodDoc)1