[jboss-svn-commits] JBoss Portal SVN: r5488 - trunk/common/src/main/org/jboss/portal/common/util
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Oct 19 18:45:24 EDT 2006
Author: chris.laprun at jboss.com
Date: 2006-10-19 18:45:23 -0400 (Thu, 19 Oct 2006)
New Revision: 5488
Modified:
trunk/common/src/main/org/jboss/portal/common/util/XML.java
Log:
Fixed typo.
Modified: trunk/common/src/main/org/jboss/portal/common/util/XML.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/XML.java 2006-10-19 22:05:43 UTC (rev 5487)
+++ trunk/common/src/main/org/jboss/portal/common/util/XML.java 2006-10-19 22:45:23 UTC (rev 5488)
@@ -45,9 +45,9 @@
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.Properties;
-import java.util.Iterator;
/**
* Utilities for dealing with XML.
@@ -104,16 +104,12 @@
/** . */
public static final boolean DEFAULT_VALIDATION = false;
- /**
- * prevent instantiation
- */
+ /** prevent instantiation */
private XML()
{
}
- /**
- * Return the builder factory.
- */
+ /** Return the builder factory. */
public static DocumentBuilderFactory getDocumentBuilderFactory()
{
return buildFactory;
@@ -142,10 +138,7 @@
}
/**
- * Serialize the document with the default format :
- * - No XML declaration
- * - Indented
- * - Encoding is UTF-8
+ * Serialize the document with the default format : - No XML declaration - Indented - Encoding is UTF-8
*
* @see #toString(Document,Properties)
*/
@@ -154,17 +147,13 @@
return toString(doc, DEFAULT_FORMAT);
}
- /**
- * @see #toString(Document)
- */
+ /** @see #toString(Document) */
public static String toString(Element element) throws ParserConfigurationException, TransformerException
{
return toString(element, DEFAULT_FORMAT);
}
- /**
- * Converts an element to a String representation.
- */
+ /** Converts an element to a String representation. */
private static String toString(Element element, Properties properties) throws ParserConfigurationException, TransformerException
{
Document doc = buildFactory.newDocumentBuilder().newDocument();
@@ -173,9 +162,7 @@
return toString(doc, properties);
}
- /**
- * Converts an document to a String representation.
- */
+ /** Converts an document to a String representation. */
private static String toString(Document doc, Properties format) throws TransformerException
{
Transformer transformer = transformerFactory.newTransformer();
@@ -187,9 +174,7 @@
return writer.toString();
}
- /**
- * Parse a string into a document.
- */
+ /** Parse a string into a document. */
public static Document toDocument(String text) throws ParserConfigurationException, SAXException, IOException
{
DocumentBuilder builder = buildFactory.newDocumentBuilder();
@@ -200,9 +185,7 @@
return doc;
}
- /**
- * Parse a string into an element.
- */
+ /** Parse a string into an element. */
public static Element toElement(String text) throws ParserConfigurationException, SAXException, IOException
{
Document doc = toDocument(text);
@@ -215,7 +198,7 @@
* @param element
* @return
* @throws IllegalArgumentException
- * @see #asString(org.w3c.dom.Element, boolean)
+ * @see #asString(org.w3c.dom.Element,boolean)
*/
public static String asString(Element element) throws IllegalArgumentException
{
@@ -244,14 +227,14 @@
Node child = children.item(i);
switch (child.getNodeType())
{
- case Node.CDATA_SECTION_NODE:
- case Node.TEXT_NODE:
- buffer.append(((Text)child).getData());
- break;
- case Node.ELEMENT_NODE:
- throw new IllegalArgumentException("Mixed content now allowed");
- default:
- break;
+ case Node.CDATA_SECTION_NODE:
+ case Node.TEXT_NODE:
+ buffer.append(((Text)child).getData());
+ break;
+ case Node.ELEMENT_NODE:
+ throw new IllegalArgumentException("Mixed content not allowed");
+ default:
+ break;
}
}
String result = buffer.toString();
@@ -320,19 +303,19 @@
List list = getChildren(element, name);
switch (list.size())
{
- case 0:
- if (strict)
- {
- throw new NoSuchElementException("Missing child " + name + " of element " + element.getNodeName());
- }
- else
- {
- return null;
- }
- case 1:
- return (Element)list.get(0);
- default:
- throw new TooManyElementException("Too many children for element " + element.getNodeName());
+ case 0:
+ if (strict)
+ {
+ throw new NoSuchElementException("Missing child " + name + " of element " + element.getNodeName());
+ }
+ else
+ {
+ return null;
+ }
+ case 1:
+ return (Element)list.get(0);
+ default:
+ throw new TooManyElementException("Too many children for element " + element.getNodeName());
}
}
More information about the jboss-svn-commits
mailing list