/** * Returns the text representation of the generated schema. */ @Override public String toString() { return XMLUtil.toString(schema); }
/** * Converts an XML document to a formatted XML string. * * @param doc The document to format. * @return Formatted XML document. */ public static String toString(Document doc) { return toString(doc, 4); }
/** * Returns an XML-formatted string that mirrors the CWF component tree starting at the specified * root. * * @param root BaseComponent whose subtree is to be traversed. * @param excludedProperties An optional list of properties that should be excluded from the * output. These may either be the property name (e.g., "uuid") or a property name * qualified by a component name (e.g., "window.uuid"). Optionally, an entry may be * followed by an "=" and a value to exclude matches with a specific value. Note that * "innerAttrs" and "outerAttrs" are always excluded. * @return The XML text representation of the component subtree. */ public static String toXML(BaseComponent root, String... excludedProperties) { return XMLUtil.toString(toDocument(root, excludedProperties)); }
/** * Returns the layout as an xml-formatted string. */ @Override public String toString() { if (root == null) { return ""; } try { Document doc = XMLUtil.parseXMLFromString("<layout/>"); Element node = doc.getDocumentElement(); buildDocument(node, root); LayoutUtil.copyAttributes(root.getAttributes(), node); node.setAttribute("version", LAYOUT_VERSION); node.setAttribute("name", layoutName); return XMLUtil.toString(doc); } catch (Exception e) { throw MiscUtil.toUnchecked(e); } }