Skip to content
Snippets Groups Projects
Commit edd4ad9b authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Added generation of prettyPrint methods for default element and attribute.

parent 6b9022a8
Branches
No related tags found
No related merge requests found
......@@ -529,6 +529,28 @@ aspect GenPrettyPrinter {
pStream.println(" getAttrValue().prettyPrint(indent,pStream);");
pStream.println(" }\n");
pStream.println(" public void __DefaultElement__.prettyPrint(String ind, PrintStream pStream) {");
pStream.println(" pStream.print(ind+\"<\"+getTAG()+\" \");");
pStream.println(" for (int i=0; i<getNumAttribute(); i++) {");
pStream.println(" getAttribute(i).prettyPrint(ind,pStream);");
pStream.println(" }");
pStream.println(" if (getNumElement() == 0) {");
pStream.println(" pStream.println(\"/> \");");
pStream.println(" } else {");
pStream.println(" pStream.println(\"> \");");
pStream.println(" String newInd = ind+\" \";");
pStream.println(" for (int i=0; i<getNumElement(); i++) {");
pStream.println(" getElement(i).prettyPrint(newInd,pStream);");
pStream.println(" }");
pStream.println(" pStream.println(ind+\"</\"+getTAG()+\"> \");");
pStream.println(" }");
pStream.println(" }\n");
pStream.println(" public void __DefaultAttribute__.prettyPrint(String indent, PrintStream pStream) {");
pStream.println(" pStream.print(\" \"+getNAME()+\"=\");");
pStream.println(" getAttrValue().prettyPrint(indent,pStream);");
pStream.println(" }\n");
Hashtable h = elementTypes();
h.putAll(attributeTypes());
Iterator iter = h.values().iterator();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment