Java Code Examples for javax.imageio.metadata.IIOMetadataFormat#getChildNames()
The following examples show how to use
javax.imageio.metadata.IIOMetadataFormat#getChildNames() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MetadataFormatPrinter.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 2
Source File: MetadataFormatPrinter.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 3
Source File: MetadataFormatPrinter.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 4
Source File: MetadataFormatPrinter.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 5
Source File: MetadataFormatPrinter.java From hottub with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 6
Source File: MetadataFormatPrinter.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 7
Source File: MetadataFormatPrinter.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 8
Source File: MetadataFormatPrinter.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 9
Source File: MetadataFormatPrinter.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 10
Source File: MetadataFormatPrinter.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 11
Source File: MetadataFormatPrinter.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private void print(IIOMetadataFormat format, String elementName) { // Don't print elements more than once if (printedElements.contains(elementName)) { return; } printedElements.add(elementName); // Add the unscheduled children of this node to a list, // and mark them as scheduled List children = new ArrayList(); String[] childNames = format.getChildNames(elementName); if (childNames != null) { for (int i = 0; i < childNames.length; i++) { String childName = childNames[i]; if (!scheduledElements.contains(childName)) { children.add(childName); scheduledElements.add(childName); } } } printElementInfo(format, elementName); printObjectInfo(format, elementName); ++indentLevel; String[] attrNames = format.getAttributeNames(elementName); for (int i = 0; i < attrNames.length; i++) { printAttributeInfo(format, elementName, attrNames[i]); } // Recurse on child nodes Iterator iter = children.iterator(); while (iter.hasNext()) { print(format, (String)iter.next()); } --indentLevel; }
Example 12
Source File: MetadataFormatPrinter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private void printElementInfo(IIOMetadataFormat format, String elementName) { println(); indent(); print("<!ELEMENT \"" + elementName + "\""); String[] childNames = format.getChildNames(elementName); boolean hasChildren = true; String separator = " "; // symbol to place between children String terminator = ""; // symbol to follow last child String repeater = ""; // "*" if repeating switch (format.getChildPolicy(elementName)) { case IIOMetadataFormat.CHILD_POLICY_EMPTY: hasChildren = false; break; case IIOMetadataFormat.CHILD_POLICY_ALL: separator = ", "; break; case IIOMetadataFormat.CHILD_POLICY_SOME: separator = "?, "; terminator = "?"; break; case IIOMetadataFormat.CHILD_POLICY_CHOICE: separator = " | "; break; case IIOMetadataFormat.CHILD_POLICY_SEQUENCE: separator = " | "; repeater = "*"; break; case IIOMetadataFormat.CHILD_POLICY_REPEAT: repeater = "*"; break; default: break; } if (hasChildren) { print(" ("); for (int i = 0; i < childNames.length - 1; i++) { print(childNames[i] + separator); } print(childNames[childNames.length - 1] + terminator); print(")" + repeater + ">"); } else { print(" EMPTY>"); } println(); String description = format.getElementDescription(elementName, null); if (description != null) { ++indentLevel; indent(); printWrapped("<!-- " + description + " -->", 5); println(); --indentLevel; } if (format.getChildPolicy(elementName) == IIOMetadataFormat.CHILD_POLICY_REPEAT) { int minChildren = format.getElementMinChildren(elementName); if (minChildren != 0) { indent(); println(" <!-- Min children: " + minChildren + " -->"); } int maxChildren = format.getElementMaxChildren(elementName); if (maxChildren != Integer.MAX_VALUE) { indent(); println(" <!-- Max children: " + maxChildren + " -->"); } } }
Example 13
Source File: MetadataFormatPrinter.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
private void printElementInfo(IIOMetadataFormat format, String elementName) { println(); indent(); print("<!ELEMENT \"" + elementName + "\""); String[] childNames = format.getChildNames(elementName); boolean hasChildren = true; String separator = " "; // symbol to place between children String terminator = ""; // symbol to follow last child String repeater = ""; // "*" if repeating switch (format.getChildPolicy(elementName)) { case IIOMetadataFormat.CHILD_POLICY_EMPTY: hasChildren = false; break; case IIOMetadataFormat.CHILD_POLICY_ALL: separator = ", "; break; case IIOMetadataFormat.CHILD_POLICY_SOME: separator = "?, "; terminator = "?"; break; case IIOMetadataFormat.CHILD_POLICY_CHOICE: separator = " | "; break; case IIOMetadataFormat.CHILD_POLICY_SEQUENCE: separator = " | "; repeater = "*"; break; case IIOMetadataFormat.CHILD_POLICY_REPEAT: repeater = "*"; break; default: break; } if (hasChildren) { print(" ("); for (int i = 0; i < childNames.length - 1; i++) { print(childNames[i] + separator); } print(childNames[childNames.length - 1] + terminator); print(")" + repeater + ">"); } else { print(" EMPTY>"); } println(); String description = format.getElementDescription(elementName, null); if (description != null) { ++indentLevel; indent(); printWrapped("<!-- " + description + " -->", 5); println(); --indentLevel; } if (format.getChildPolicy(elementName) == IIOMetadataFormat.CHILD_POLICY_REPEAT) { int minChildren = format.getElementMinChildren(elementName); if (minChildren != 0) { indent(); println(" <!-- Min children: " + minChildren + " -->"); } int maxChildren = format.getElementMaxChildren(elementName); if (maxChildren != Integer.MAX_VALUE) { indent(); println(" <!-- Max children: " + maxChildren + " -->"); } } }
Example 14
Source File: MetadataFormatPrinter.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private void printElementInfo(IIOMetadataFormat format, String elementName) { println(); indent(); print("<!ELEMENT \"" + elementName + "\""); String[] childNames = format.getChildNames(elementName); boolean hasChildren = true; String separator = " "; // symbol to place between children String terminator = ""; // symbol to follow last child String repeater = ""; // "*" if repeating switch (format.getChildPolicy(elementName)) { case IIOMetadataFormat.CHILD_POLICY_EMPTY: hasChildren = false; break; case IIOMetadataFormat.CHILD_POLICY_ALL: separator = ", "; break; case IIOMetadataFormat.CHILD_POLICY_SOME: separator = "?, "; terminator = "?"; break; case IIOMetadataFormat.CHILD_POLICY_CHOICE: separator = " | "; break; case IIOMetadataFormat.CHILD_POLICY_SEQUENCE: separator = " | "; repeater = "*"; break; case IIOMetadataFormat.CHILD_POLICY_REPEAT: repeater = "*"; break; default: break; } if (hasChildren) { print(" ("); for (int i = 0; i < childNames.length - 1; i++) { print(childNames[i] + separator); } print(childNames[childNames.length - 1] + terminator); print(")" + repeater + ">"); } else { print(" EMPTY>"); } println(); String description = format.getElementDescription(elementName, null); if (description != null) { ++indentLevel; indent(); printWrapped("<!-- " + description + " -->", 5); println(); --indentLevel; } if (format.getChildPolicy(elementName) == IIOMetadataFormat.CHILD_POLICY_REPEAT) { int minChildren = format.getElementMinChildren(elementName); if (minChildren != 0) { indent(); println(" <!-- Min children: " + minChildren + " -->"); } int maxChildren = format.getElementMaxChildren(elementName); if (maxChildren != Integer.MAX_VALUE) { indent(); println(" <!-- Max children: " + maxChildren + " -->"); } } }
Example 15
Source File: MetadataFormatPrinter.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
private void printElementInfo(IIOMetadataFormat format, String elementName) { println(); indent(); print("<!ELEMENT \"" + elementName + "\""); String[] childNames = format.getChildNames(elementName); boolean hasChildren = true; String separator = " "; // symbol to place between children String terminator = ""; // symbol to follow last child String repeater = ""; // "*" if repeating switch (format.getChildPolicy(elementName)) { case IIOMetadataFormat.CHILD_POLICY_EMPTY: hasChildren = false; break; case IIOMetadataFormat.CHILD_POLICY_ALL: separator = ", "; break; case IIOMetadataFormat.CHILD_POLICY_SOME: separator = "?, "; terminator = "?"; break; case IIOMetadataFormat.CHILD_POLICY_CHOICE: separator = " | "; break; case IIOMetadataFormat.CHILD_POLICY_SEQUENCE: separator = " | "; repeater = "*"; break; case IIOMetadataFormat.CHILD_POLICY_REPEAT: repeater = "*"; break; default: break; } if (hasChildren) { print(" ("); for (int i = 0; i < childNames.length - 1; i++) { print(childNames[i] + separator); } print(childNames[childNames.length - 1] + terminator); print(")" + repeater + ">"); } else { print(" EMPTY>"); } println(); String description = format.getElementDescription(elementName, null); if (description != null) { ++indentLevel; indent(); printWrapped("<!-- " + description + " -->", 5); println(); --indentLevel; } if (format.getChildPolicy(elementName) == IIOMetadataFormat.CHILD_POLICY_REPEAT) { int minChildren = format.getElementMinChildren(elementName); if (minChildren != 0) { indent(); println(" <!-- Min children: " + minChildren + " -->"); } int maxChildren = format.getElementMaxChildren(elementName); if (maxChildren != Integer.MAX_VALUE) { indent(); println(" <!-- Max children: " + maxChildren + " -->"); } } }
Example 16
Source File: MetadataFormatPrinter.java From hottub with GNU General Public License v2.0 | 4 votes |
private void printElementInfo(IIOMetadataFormat format, String elementName) { println(); indent(); print("<!ELEMENT \"" + elementName + "\""); String[] childNames = format.getChildNames(elementName); boolean hasChildren = true; String separator = " "; // symbol to place between children String terminator = ""; // symbol to follow last child String repeater = ""; // "*" if repeating switch (format.getChildPolicy(elementName)) { case IIOMetadataFormat.CHILD_POLICY_EMPTY: hasChildren = false; break; case IIOMetadataFormat.CHILD_POLICY_ALL: separator = ", "; break; case IIOMetadataFormat.CHILD_POLICY_SOME: separator = "?, "; terminator = "?"; break; case IIOMetadataFormat.CHILD_POLICY_CHOICE: separator = " | "; break; case IIOMetadataFormat.CHILD_POLICY_SEQUENCE: separator = " | "; repeater = "*"; break; case IIOMetadataFormat.CHILD_POLICY_REPEAT: repeater = "*"; break; default: break; } if (hasChildren) { print(" ("); for (int i = 0; i < childNames.length - 1; i++) { print(childNames[i] + separator); } print(childNames[childNames.length - 1] + terminator); print(")" + repeater + ">"); } else { print(" EMPTY>"); } println(); String description = format.getElementDescription(elementName, null); if (description != null) { ++indentLevel; indent(); printWrapped("<!-- " + description + " -->", 5); println(); --indentLevel; } if (format.getChildPolicy(elementName) == IIOMetadataFormat.CHILD_POLICY_REPEAT) { int minChildren = format.getElementMinChildren(elementName); if (minChildren != 0) { indent(); println(" <!-- Min children: " + minChildren + " -->"); } int maxChildren = format.getElementMaxChildren(elementName); if (maxChildren != Integer.MAX_VALUE) { indent(); println(" <!-- Max children: " + maxChildren + " -->"); } } }
Example 17
Source File: MetadataFormatPrinter.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
private void printElementInfo(IIOMetadataFormat format, String elementName) { println(); indent(); print("<!ELEMENT \"" + elementName + "\""); String[] childNames = format.getChildNames(elementName); boolean hasChildren = true; String separator = " "; // symbol to place between children String terminator = ""; // symbol to follow last child String repeater = ""; // "*" if repeating switch (format.getChildPolicy(elementName)) { case IIOMetadataFormat.CHILD_POLICY_EMPTY: hasChildren = false; break; case IIOMetadataFormat.CHILD_POLICY_ALL: separator = ", "; break; case IIOMetadataFormat.CHILD_POLICY_SOME: separator = "?, "; terminator = "?"; break; case IIOMetadataFormat.CHILD_POLICY_CHOICE: separator = " | "; break; case IIOMetadataFormat.CHILD_POLICY_SEQUENCE: separator = " | "; repeater = "*"; break; case IIOMetadataFormat.CHILD_POLICY_REPEAT: repeater = "*"; break; default: break; } if (hasChildren) { print(" ("); for (int i = 0; i < childNames.length - 1; i++) { print(childNames[i] + separator); } print(childNames[childNames.length - 1] + terminator); print(")" + repeater + ">"); } else { print(" EMPTY>"); } println(); String description = format.getElementDescription(elementName, null); if (description != null) { ++indentLevel; indent(); printWrapped("<!-- " + description + " -->", 5); println(); --indentLevel; } if (format.getChildPolicy(elementName) == IIOMetadataFormat.CHILD_POLICY_REPEAT) { int minChildren = format.getElementMinChildren(elementName); if (minChildren != 0) { indent(); println(" <!-- Min children: " + minChildren + " -->"); } int maxChildren = format.getElementMaxChildren(elementName); if (maxChildren != Integer.MAX_VALUE) { indent(); println(" <!-- Max children: " + maxChildren + " -->"); } } }
Example 18
Source File: MetadataFormatPrinter.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
private void printElementInfo(IIOMetadataFormat format, String elementName) { println(); indent(); print("<!ELEMENT \"" + elementName + "\""); String[] childNames = format.getChildNames(elementName); boolean hasChildren = true; String separator = " "; // symbol to place between children String terminator = ""; // symbol to follow last child String repeater = ""; // "*" if repeating switch (format.getChildPolicy(elementName)) { case IIOMetadataFormat.CHILD_POLICY_EMPTY: hasChildren = false; break; case IIOMetadataFormat.CHILD_POLICY_ALL: separator = ", "; break; case IIOMetadataFormat.CHILD_POLICY_SOME: separator = "?, "; terminator = "?"; break; case IIOMetadataFormat.CHILD_POLICY_CHOICE: separator = " | "; break; case IIOMetadataFormat.CHILD_POLICY_SEQUENCE: separator = " | "; repeater = "*"; break; case IIOMetadataFormat.CHILD_POLICY_REPEAT: repeater = "*"; break; default: break; } if (hasChildren) { print(" ("); for (int i = 0; i < childNames.length - 1; i++) { print(childNames[i] + separator); } print(childNames[childNames.length - 1] + terminator); print(")" + repeater + ">"); } else { print(" EMPTY>"); } println(); String description = format.getElementDescription(elementName, null); if (description != null) { ++indentLevel; indent(); printWrapped("<!-- " + description + " -->", 5); println(); --indentLevel; } if (format.getChildPolicy(elementName) == IIOMetadataFormat.CHILD_POLICY_REPEAT) { int minChildren = format.getElementMinChildren(elementName); if (minChildren != 0) { indent(); println(" <!-- Min children: " + minChildren + " -->"); } int maxChildren = format.getElementMaxChildren(elementName); if (maxChildren != Integer.MAX_VALUE) { indent(); println(" <!-- Max children: " + maxChildren + " -->"); } } }
Example 19
Source File: MetadataFormatPrinter.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private void printElementInfo(IIOMetadataFormat format, String elementName) { println(); indent(); print("<!ELEMENT \"" + elementName + "\""); String[] childNames = format.getChildNames(elementName); boolean hasChildren = true; String separator = " "; // symbol to place between children String terminator = ""; // symbol to follow last child String repeater = ""; // "*" if repeating switch (format.getChildPolicy(elementName)) { case IIOMetadataFormat.CHILD_POLICY_EMPTY: hasChildren = false; break; case IIOMetadataFormat.CHILD_POLICY_ALL: separator = ", "; break; case IIOMetadataFormat.CHILD_POLICY_SOME: separator = "?, "; terminator = "?"; break; case IIOMetadataFormat.CHILD_POLICY_CHOICE: separator = " | "; break; case IIOMetadataFormat.CHILD_POLICY_SEQUENCE: separator = " | "; repeater = "*"; break; case IIOMetadataFormat.CHILD_POLICY_REPEAT: repeater = "*"; break; default: break; } if (hasChildren) { print(" ("); for (int i = 0; i < childNames.length - 1; i++) { print(childNames[i] + separator); } print(childNames[childNames.length - 1] + terminator); print(")" + repeater + ">"); } else { print(" EMPTY>"); } println(); String description = format.getElementDescription(elementName, null); if (description != null) { ++indentLevel; indent(); printWrapped("<!-- " + description + " -->", 5); println(); --indentLevel; } if (format.getChildPolicy(elementName) == IIOMetadataFormat.CHILD_POLICY_REPEAT) { int minChildren = format.getElementMinChildren(elementName); if (minChildren != 0) { indent(); println(" <!-- Min children: " + minChildren + " -->"); } int maxChildren = format.getElementMaxChildren(elementName); if (maxChildren != Integer.MAX_VALUE) { indent(); println(" <!-- Max children: " + maxChildren + " -->"); } } }
Example 20
Source File: MetadataFormatPrinter.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
private void printElementInfo(IIOMetadataFormat format, String elementName) { println(); indent(); print("<!ELEMENT \"" + elementName + "\""); String[] childNames = format.getChildNames(elementName); boolean hasChildren = true; String separator = " "; // symbol to place between children String terminator = ""; // symbol to follow last child String repeater = ""; // "*" if repeating switch (format.getChildPolicy(elementName)) { case IIOMetadataFormat.CHILD_POLICY_EMPTY: hasChildren = false; break; case IIOMetadataFormat.CHILD_POLICY_ALL: separator = ", "; break; case IIOMetadataFormat.CHILD_POLICY_SOME: separator = "?, "; terminator = "?"; break; case IIOMetadataFormat.CHILD_POLICY_CHOICE: separator = " | "; break; case IIOMetadataFormat.CHILD_POLICY_SEQUENCE: separator = " | "; repeater = "*"; break; case IIOMetadataFormat.CHILD_POLICY_REPEAT: repeater = "*"; break; default: break; } if (hasChildren) { print(" ("); for (int i = 0; i < childNames.length - 1; i++) { print(childNames[i] + separator); } print(childNames[childNames.length - 1] + terminator); print(")" + repeater + ">"); } else { print(" EMPTY>"); } println(); String description = format.getElementDescription(elementName, null); if (description != null) { ++indentLevel; indent(); printWrapped("<!-- " + description + " -->", 5); println(); --indentLevel; } if (format.getChildPolicy(elementName) == IIOMetadataFormat.CHILD_POLICY_REPEAT) { int minChildren = format.getElementMinChildren(elementName); if (minChildren != 0) { indent(); println(" <!-- Min children: " + minChildren + " -->"); } int maxChildren = format.getElementMaxChildren(elementName); if (maxChildren != Integer.MAX_VALUE) { indent(); println(" <!-- Max children: " + maxChildren + " -->"); } } }