use of com.emc.apidocs.model.ApiField in project coprhd-controller by CoprHD.
the class Utils method dump.
public static void dump(ApiMethod apiMethod) {
System.out.println("=================================");
System.out.println(apiMethod.httpMethod + " " + apiMethod.path);
System.out.println("JavaMethod:" + apiMethod.javaMethodName);
System.out.println("Brief: " + apiMethod.brief);
System.out.println("Description:" + apiMethod.description);
System.out.println("\nPATH PARAMETERS:");
for (ApiField param : apiMethod.pathParameters) {
System.out.println("- [" + param.name + "] " + param.description);
}
System.out.println("\nQUERY PARAMETERS");
for (ApiField param : apiMethod.queryParameters) {
System.out.println("- [" + param.name + "] " + param.description);
}
System.out.println("\nROLES:");
for (String role : apiMethod.roles) {
System.out.println("- " + role);
}
System.out.println("\nACLS:");
for (String acl : apiMethod.acls) {
System.out.println("- " + acl);
}
if (apiMethod.input != null) {
System.out.println("INPUT: " + apiMethod.input.name);
}
if (apiMethod.output != null) {
System.out.println("OUTPUT: " + apiMethod.output.name);
dumpAsXml(apiMethod.output, 0);
}
}
use of com.emc.apidocs.model.ApiField in project coprhd-controller by CoprHD.
the class Utils method generateJSON.
public static String generateJSON(ApiClass element, StringBuffer buffer) {
buffer.append("{\n");
int counter = 0;
for (ApiField field : element.fields) {
generateJSON(field, buffer);
counter++;
if (counter < element.fields.size()) {
buffer.append(",\n");
}
}
buffer.append("}");
return buffer.toString();
}
use of com.emc.apidocs.model.ApiField 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