Commits

rainerh  committed 8471131

Code formatting and added missing copyrights

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2648573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 3e3e3ad

Comments (0)

Files changed (9)

File src/java/com/opensymphony/webwork/views/xslt/AdapterNode.java

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.views.xslt;
 
 import org.w3c.dom.Node;

File src/java/com/opensymphony/webwork/views/xslt/ProxyAttrAdapter.java

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.views.xslt;
 
 import org.apache.commons.logging.Log;
  * @author Pat Niemeyer (pat@pat.net)
  *
  */
-public class ProxyAttrAdapter extends ProxyNodeAdapter implements Attr
-{
-	private Log log = LogFactory.getLog(this.getClass());
-
-	public ProxyAttrAdapter( AdapterFactory factory, AdapterNode parent, Attr value ) {
-		super( factory, parent, value );
-	}
-
-	// convenience
-	protected Attr attr() {
-		return (Attr)getPropertyValue();
-	}
-
-	// Proxied Attr methods
-
-	public String getName() {
-		return attr().getName();
-	}
-	public boolean getSpecified() {
-		return attr().getSpecified();
-	}
-	public String getValue() {
-		return attr().getValue();
-	}
-	public void setValue( String string ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public Element getOwnerElement() {
-		return (Element)getParent();
-	}
+public class ProxyAttrAdapter extends ProxyNodeAdapter implements Attr {
+    private Log log = LogFactory.getLog(this.getClass());
+
+    public ProxyAttrAdapter(AdapterFactory factory, AdapterNode parent, Attr value) {
+        super(factory, parent, value);
+    }
+
+    // convenience
+    protected Attr attr() {
+        return (Attr) getPropertyValue();
+    }
+
+    // Proxied Attr methods
+
+    public String getName() {
+        return attr().getName();
+    }
+
+    public boolean getSpecified() {
+        return attr().getSpecified();
+    }
+
+    public String getValue() {
+        return attr().getValue();
+    }
+
+    public void setValue(String string) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public Element getOwnerElement() {
+        return (Element) getParent();
+    }
 
     // DOM level 3
 
 
     // End Proxied Attr methods
 
-	public String toString() { return "ProxyAttribute for: "+attr(); }
+    public String toString() {
+        return "ProxyAttribute for: " + attr();
+    }
 }
 

File src/java/com/opensymphony/webwork/views/xslt/ProxyElementAdapter.java

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.views.xslt;
 
 import org.apache.commons.logging.Log;
 	Note: this class wants to be (extend) both an AbstractElementAdapter
 	and ProxyElementAdapter, but its proxy-ness is winning right now.
 */
-public class ProxyElementAdapter extends ProxyNodeAdapter implements Element
-{
-	private Log log = LogFactory.getLog(this.getClass());
-
-	public ProxyElementAdapter( AdapterFactory factory, AdapterNode parent, Element value ) {
-		super( factory, parent, value );
-	}
-
-	/**
-	 * Get the proxied Element
-	 */
-	protected Element element() {
-		return (Element)getPropertyValue();
-	}
-
-	protected List buildChildAdapters()
-	{
-		List adapters = new ArrayList();
-		NodeList children = node().getChildNodes();
-		for ( int i = 0; i < children.getLength(); i++ ) {
-			Node child = children.item( i );
-			Node adapter = wrap( child );
-			if ( adapter != null )
-			{
-				log.debug( "wrapped child node: "+child.getNodeName());
-				adapters.add( adapter );
-			}
-		}
-		return adapters;
-	}
-
-	// Proxied Element methods
-
-	public String getTagName()
-	{
-		return element().getTagName();
-	}
-	public boolean hasAttribute( String name )
-	{
-		return element().hasAttribute( name );
-	}
-	public String getAttribute( String name )
-	{
-		return element().getAttribute( name );
-	}
-	public boolean hasAttributeNS( String namespaceURI, String localName )
-	{
-		return element().hasAttributeNS( namespaceURI, localName );
-	}
-	public Attr getAttributeNode( String name )
-	{
-		log.debug( "wrapping attribute" );
-		return (Attr)wrap( element().getAttributeNode( name ) );
-	}
-
-	// I'm overriding this just for clarity.  The base impl is correct.
-	public NodeList getElementsByTagName( String name )
-	{
-		return super.getElementsByTagName( name );
-	}
-
-	public String getAttributeNS( String namespaceURI, String localName )
-	{
-		return element().getAttributeNS( namespaceURI, localName );
-	}
-	public Attr getAttributeNodeNS( String namespaceURI, String localName )
-	{
-		return (Attr)wrap( element().getAttributeNodeNS( namespaceURI, localName ) );
-	}
-	public NodeList getElementsByTagNameNS( String namespaceURI, String localName )
-	{
-		return super.getElementsByTagNameNS( namespaceURI, localName );
-	}
-
-	// Unsupported mutators of Element
-
-	public void removeAttribute( String name ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public void removeAttributeNS( String namespaceURI, String localName ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public void setAttribute( String name, String value ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public Attr removeAttributeNode( Attr oldAttr ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public Attr setAttributeNode( Attr newAttr ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public Attr setAttributeNodeNS( Attr newAttr ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public void setAttributeNS( String namespaceURI, String qualifiedName, String value ) throws DOMException
-	{
-		throw new UnsupportedOperationException();
-	}
-
-	// end proxied Element methods
+public class ProxyElementAdapter extends ProxyNodeAdapter implements Element {
+    private Log log = LogFactory.getLog(this.getClass());
+
+    public ProxyElementAdapter(AdapterFactory factory, AdapterNode parent, Element value) {
+        super(factory, parent, value);
+    }
+
+    /**
+     * Get the proxied Element
+     */
+    protected Element element() {
+        return (Element) getPropertyValue();
+    }
+
+    protected List buildChildAdapters() {
+        List adapters = new ArrayList();
+        NodeList children = node().getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node child = children.item(i);
+            Node adapter = wrap(child);
+            if (adapter != null) {
+                log.debug("wrapped child node: " + child.getNodeName());
+                adapters.add(adapter);
+            }
+        }
+        return adapters;
+    }
+
+    // Proxied Element methods
+
+    public String getTagName() {
+        return element().getTagName();
+    }
+
+    public boolean hasAttribute(String name) {
+        return element().hasAttribute(name);
+    }
+
+    public String getAttribute(String name) {
+        return element().getAttribute(name);
+    }
+
+    public boolean hasAttributeNS(String namespaceURI, String localName) {
+        return element().hasAttributeNS(namespaceURI, localName);
+    }
+
+    public Attr getAttributeNode(String name) {
+        log.debug("wrapping attribute");
+        return (Attr) wrap(element().getAttributeNode(name));
+    }
+
+    // I'm overriding this just for clarity.  The base impl is correct.
+    public NodeList getElementsByTagName(String name) {
+        return super.getElementsByTagName(name);
+    }
+
+    public String getAttributeNS(String namespaceURI, String localName) {
+        return element().getAttributeNS(namespaceURI, localName);
+    }
+
+    public Attr getAttributeNodeNS(String namespaceURI, String localName) {
+        return (Attr) wrap(element().getAttributeNodeNS(namespaceURI, localName));
+    }
+
+    public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
+        return super.getElementsByTagNameNS(namespaceURI, localName);
+    }
+
+    // Unsupported mutators of Element
+
+    public void removeAttribute(String name) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setAttribute(String name, String value) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public Attr setAttributeNode(Attr newAttr) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    // end proxied Element methods
 
     // unsupported DOM level 3 methods
 
 
     // end DOM level 3 methods
 
-    public String toString() { return "ProxyElement for: "+element(); }
+    public String toString() {
+        return "ProxyElement for: " + element();
+    }
 }
 

File src/java/com/opensymphony/webwork/views/xslt/ProxyNamedNodeMap.java

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.views.xslt;
 
 import org.w3c.dom.DOMException;
   here as we do with "child" adapters.  In that case we need to preserve identity
   in order to support finding the next/previous siblings.
  */
-public class ProxyNamedNodeMap implements NamedNodeMap
-{
-	private NamedNodeMap nodes;
-	private AdapterFactory adapterFactory;
-	private AdapterNode parent;
-	private Log log = LogFactory.getLog(this.getClass());
-
-	public ProxyNamedNodeMap( AdapterFactory factory, AdapterNode parent, NamedNodeMap nodes ) {
-		this.nodes = nodes;
-		this.adapterFactory = factory;
-		this.parent = parent;
-	}
-
-	protected Node wrap( Node node ) {
-		return adapterFactory.proxyNode( parent, node );
-	}
-
-	public int getLength() { return nodes.getLength(); }
-
-	public Node item( int index ) {
-		return wrap( nodes.item( index ) );
-	}
-	public Node getNamedItem( String name ) {
-		return wrap((Node)nodes.getNamedItem(name));
-	}
-	public Node removeNamedItem( String name ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public Node setNamedItem( Node arg ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public Node setNamedItemNS( Node arg ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
-	public Node getNamedItemNS( String namespaceURI, String localName ) {
-		return wrap( (Node)nodes.getNamedItemNS( namespaceURI, localName ) );
-	}
-	public Node removeNamedItemNS( String namespaceURI, String localName ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
+public class ProxyNamedNodeMap implements NamedNodeMap {
+    private NamedNodeMap nodes;
+    private AdapterFactory adapterFactory;
+    private AdapterNode parent;
+    private Log log = LogFactory.getLog(this.getClass());
+
+    public ProxyNamedNodeMap(AdapterFactory factory, AdapterNode parent, NamedNodeMap nodes) {
+        this.nodes = nodes;
+        this.adapterFactory = factory;
+        this.parent = parent;
+    }
+
+    protected Node wrap(Node node) {
+        return adapterFactory.proxyNode(parent, node);
+    }
+
+    public int getLength() {
+        return nodes.getLength();
+    }
+
+    public Node item(int index) {
+        return wrap(nodes.item(index));
+    }
+
+    public Node getNamedItem(String name) {
+        return wrap((Node) nodes.getNamedItem(name));
+    }
+
+    public Node removeNamedItem(String name) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public Node setNamedItem(Node arg) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public Node setNamedItemNS(Node arg) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
+
+    public Node getNamedItemNS(String namespaceURI, String localName) {
+        return wrap((Node) nodes.getNamedItemNS(namespaceURI, localName));
+    }
+
+    public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
 }

File src/java/com/opensymphony/webwork/views/xslt/ProxyNodeAdapter.java

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.views.xslt;
 
 import org.apache.commons.logging.Log;
  *
  * @author Pat Niemeyer (pat@pat.net)
  */
-public abstract class ProxyNodeAdapter extends AbstractAdapterNode
-{
-	private Log log = LogFactory.getLog(this.getClass());
-
-	public ProxyNodeAdapter( AdapterFactory factory, AdapterNode parent, Node value )
-	{
-		setContext( factory, parent, "document"/*propname unused*/, value );
-		log.debug( "proxied node is: " + value );
-		log.debug( "node class is: " + value.getClass() );
-		log.debug( "node type is: " + value.getNodeType() );
-		log.debug( "node name is: " + value.getNodeName() );
-	}
-
-	/**
-	 * Get the proxied Node value
-	 */
-	protected Node node() {
-		return (Node)getPropertyValue();
-	}
-
-	/**
-	 * Get and adapter to wrap the proxied node.
-	 * @param node
-	 */
-	protected Node wrap( Node node ) {
-		return getAdapterFactory().proxyNode( this, node );
-	}
-	protected NamedNodeMap wrap( NamedNodeMap nnm ) {
-		return getAdapterFactory().proxyNamedNodeMap( this, nnm );
-	}
-	//protected NodeList wrap( NodeList nl ) { }
-
-	//protected Node unwrap( Node child ) {
-	//	return ((ProxyNodeAdapter)child).node();
-	//}
-
-	// Proxied Node methods
-
-	public String getNodeName()
-	{
-		log.trace( "getNodeName" );
-		return node().getNodeName();
-	}
-
-	public String getNodeValue() throws DOMException
-	{
-		log.trace("getNodeValue");
-		return node().getNodeValue();
-	}
-
-	public short getNodeType()
-	{
-		if ( log.isTraceEnabled() )
-			log.trace( "getNodeType: " +getNodeName() +": "+ node().getNodeType() );
-		return node().getNodeType();
-	}
-
-	public NamedNodeMap getAttributes()
-	{
-		NamedNodeMap nnm = wrap( node().getAttributes() );
-		if ( log.isTraceEnabled() )
-			log.trace( "getAttributes: " + nnm );
-		return nnm;
-	}
-
-	public boolean hasChildNodes()
-	{
-		log.trace("hasChildNodes");
-		return node().hasChildNodes();
-	}
-
-	public boolean isSupported( String s, String s1 )
-	{
-		log.trace("isSupported");
-		// Is this ok?  What kind of features are they asking about?
-		return node().isSupported( s, s1 );
-	}
-
-	public String getNamespaceURI()
-	{
-		log.trace("getNamespaceURI");
-		return node().getNamespaceURI();
-	}
-
-	public String getPrefix()
-	{
-		log.trace("getPrefix");
-		return node().getPrefix();
-	}
-
-	public String getLocalName()
-	{
-		log.trace("getLocalName");
-		return node().getLocalName();
-	}
-
-	public boolean hasAttributes()
-	{
-		log.trace("hasAttributes");
-		return node().hasAttributes();
-	}
-
-	// End proxied Node methods
-
-	public String toString() { return "ProxyNode for: "+node(); }
+public abstract class ProxyNodeAdapter extends AbstractAdapterNode {
+    private Log log = LogFactory.getLog(this.getClass());
+
+    public ProxyNodeAdapter(AdapterFactory factory, AdapterNode parent, Node value) {
+        setContext(factory, parent, "document"/*propname unused*/, value);
+        log.debug("proxied node is: " + value);
+        log.debug("node class is: " + value.getClass());
+        log.debug("node type is: " + value.getNodeType());
+        log.debug("node name is: " + value.getNodeName());
+    }
+
+    /**
+     * Get the proxied Node value
+     */
+    protected Node node() {
+        return (Node) getPropertyValue();
+    }
+
+    /**
+     * Get and adapter to wrap the proxied node.
+     *
+     * @param node
+     */
+    protected Node wrap(Node node) {
+        return getAdapterFactory().proxyNode(this, node);
+    }
+
+    protected NamedNodeMap wrap(NamedNodeMap nnm) {
+        return getAdapterFactory().proxyNamedNodeMap(this, nnm);
+    }
+    //protected NodeList wrap( NodeList nl ) { }
+
+    //protected Node unwrap( Node child ) {
+    //	return ((ProxyNodeAdapter)child).node();
+    //}
+
+    // Proxied Node methods
+
+    public String getNodeName() {
+        log.trace("getNodeName");
+        return node().getNodeName();
+    }
+
+    public String getNodeValue() throws DOMException {
+        log.trace("getNodeValue");
+        return node().getNodeValue();
+    }
+
+    public short getNodeType() {
+        if (log.isTraceEnabled())
+            log.trace("getNodeType: " + getNodeName() + ": " + node().getNodeType());
+        return node().getNodeType();
+    }
+
+    public NamedNodeMap getAttributes() {
+        NamedNodeMap nnm = wrap(node().getAttributes());
+        if (log.isTraceEnabled())
+            log.trace("getAttributes: " + nnm);
+        return nnm;
+    }
+
+    public boolean hasChildNodes() {
+        log.trace("hasChildNodes");
+        return node().hasChildNodes();
+    }
+
+    public boolean isSupported(String s, String s1) {
+        log.trace("isSupported");
+        // Is this ok?  What kind of features are they asking about?
+        return node().isSupported(s, s1);
+    }
+
+    public String getNamespaceURI() {
+        log.trace("getNamespaceURI");
+        return node().getNamespaceURI();
+    }
+
+    public String getPrefix() {
+        log.trace("getPrefix");
+        return node().getPrefix();
+    }
+
+    public String getLocalName() {
+        log.trace("getLocalName");
+        return node().getLocalName();
+    }
+
+    public boolean hasAttributes() {
+        log.trace("hasAttributes");
+        return node().hasAttributes();
+    }
+
+    // End proxied Node methods
+
+    public String toString() {
+        return "ProxyNode for: " + node();
+    }
 }
 

File src/java/com/opensymphony/webwork/views/xslt/ProxyTextNodeAdapter.java

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.views.xslt;
 
 import org.apache.commons.logging.Log;
  *
  * @author Pat Niemeyer (pat@pat.net)
  */
-public class ProxyTextNodeAdapter extends ProxyNodeAdapter implements Text
-{
-	private Log log = LogFactory.getLog(this.getClass());
+public class ProxyTextNodeAdapter extends ProxyNodeAdapter implements Text {
+    private Log log = LogFactory.getLog(this.getClass());
 
-	public ProxyTextNodeAdapter( AdapterFactory factory, AdapterNode parent, Text value ) {
-		super( factory, parent, value );
-	}
+    public ProxyTextNodeAdapter(AdapterFactory factory, AdapterNode parent, Text value) {
+        super(factory, parent, value);
+    }
 
-	// convenience
-	Text text() { return (Text)getPropertyValue(); }
+    // convenience
+    Text text() {
+        return (Text) getPropertyValue();
+    }
 
-	public String toString() { return "ProxyTextNode for: "+text(); }
+    public String toString() {
+        return "ProxyTextNode for: " + text();
+    }
 
-	public Text splitText( int offset ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
+    public Text splitText(int offset) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
 
-	public int getLength() {
-		return text().getLength();
-	}
+    public int getLength() {
+        return text().getLength();
+    }
 
-	public void deleteData( int offset, int count ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
+    public void deleteData(int offset, int count) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
 
-	public String getData() throws DOMException {
-		return text().getData();
-	}
+    public String getData() throws DOMException {
+        return text().getData();
+    }
 
-	public String substringData( int offset, int count ) throws DOMException {
-		return text().substringData( offset, count );
-	}
+    public String substringData(int offset, int count) throws DOMException {
+        return text().substringData(offset, count);
+    }
 
-	public void replaceData( int offset, int count, String arg ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
+    public void replaceData(int offset, int count, String arg) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
 
-	public void insertData( int offset, String arg ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
+    public void insertData(int offset, String arg) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
 
-	public void appendData( String arg ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
+    public void appendData(String arg) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
 
-	public void setData( String data ) throws DOMException {
-		throw new UnsupportedOperationException();
-	}
+    public void setData(String data) throws DOMException {
+        throw new UnsupportedOperationException();
+    }
 
     // DOM level 3
 

File src/java/com/opensymphony/webwork/views/xslt/SimpleAdapterDocument.java

     //~ Constructors ///////////////////////////////////////////////////////////
 
     public SimpleAdapterDocument(
-        AdapterFactory adapterFactory, AdapterNode parent, String propertyName, Object value)
-    {
-        setContext( adapterFactory, parent, propertyName, value );
+            AdapterFactory adapterFactory, AdapterNode parent, String propertyName, Object value) {
+        setContext(adapterFactory, parent, propertyName, value);
 
     }
 
-    public void setPropertyValue( Object prop )
-    {
-        super.setPropertyValue( prop );
+    public void setPropertyValue(Object prop) {
+        super.setPropertyValue(prop);
         rootElement = null; // recreate the root element
     }
 
     /**
      * Lazily construct the root element adapter from the value object.
      */
-    private Element getRootElement()
-    {
-        if ( rootElement != null )
+    private Element getRootElement() {
+        if (rootElement != null)
             return rootElement;
 
         Node node = getAdapterFactory().adaptNode(
-            this, getPropertyName(), getPropertyValue() );
-        if ( node instanceof Element )
-            rootElement = (Element)node;
+                this, getPropertyName(), getPropertyValue());
+        if (node instanceof Element)
+            rootElement = (Element) node;
         else
             throw new WebWorkException(
-                "Document adapter expected to wrap an Element type.  Node is not an element:" + node );
+                    "Document adapter expected to wrap an Element type.  Node is not an element:" + node);
 
         return rootElement;
     }
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    protected List getChildAdapters()
-    {
-        return Arrays.asList( new Object[] { getRootElement() } );
+    protected List getChildAdapters() {
+        return Arrays.asList(new Object[]{getRootElement()});
     }
 
     public NodeList getChildNodes() {
-        return new NodeList()
-        {
+        return new NodeList() {
             public Node item(int i) {
                 return getRootElement();
             }
         return null;
     }
 
-    public Node getChildAfter( Node child ) { return null; }
-    public Node getChildBefore( Node child ) { return null; }
+    public Node getChildAfter(Node child) {
+        return null;
+    }
+
+    public Node getChildBefore(Node child) {
+        return null;
+    }
 
     // DOM level 3
 

File src/java/com/opensymphony/webwork/views/xslt/SimpleNodeList.java

  */
 public class SimpleNodeList implements NodeList {
     //~ Instance fields ////////////////////////////////////////////////////////
-	private Log log = LogFactory.getLog(SimpleNodeList.class);
+    private Log log = LogFactory.getLog(SimpleNodeList.class);
 
     private List nodes;
 
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    public int getLength()
-	{
-		if ( log.isTraceEnabled() )
-			log.trace( "getLength: " + nodes.size() );
-		return nodes.size();
-	}
+    public int getLength() {
+        if (log.isTraceEnabled())
+            log.trace("getLength: " + nodes.size());
+        return nodes.size();
+    }
 
     public Node item(int i) {
-		log.trace( "getItem: " + i );
+        log.trace("getItem: " + i);
         return (Node) nodes.get(i);
     }
 
-	public String toString()
-	{
-		StringBuffer sb = new StringBuffer( "SimpleNodeList: [" );
-		for ( int i = 0; i < getLength(); i++ )
-			sb.append( item( i ).getNodeName() + "," );
-		sb.append( "]" );
-		return sb.toString();
-	}
+    public String toString() {
+        StringBuffer sb = new StringBuffer("SimpleNodeList: [");
+        for (int i = 0; i < getLength(); i++)
+            sb.append(item(i).getNodeName() + ",");
+        sb.append("]");
+        return sb.toString();
+    }
 }

File src/java/com/opensymphony/webwork/views/xslt/StringAdapter.java

  * @author <a href="mailto:meier@meisterbohne.de">Philipp Meier</a>
  * @author Pat Niemeyer (pat@pat.net)
  */
-public class StringAdapter extends AbstractAdapterElement
-{
+public class StringAdapter extends AbstractAdapterElement {
     private Log log = LogFactory.getLog(this.getClass());
     boolean parseStringAsXML = false;
 
     //~ Constructors ///////////////////////////////////////////////////////////
 
-    public StringAdapter() { }
+    public StringAdapter() {
+    }
 
     public StringAdapter(AdapterFactory adapterFactory, AdapterNode parent, String propertyName, String value) {
-        setContext( adapterFactory, parent, propertyName, value );
+        setContext(adapterFactory, parent, propertyName, value);
     }
 
     /**
      * Get the object to be adapted as a String value.
-     *
+     * <p/>
      * This method can be overridden by subclasses that wish to use StringAdapter
      * as a simplified customizable XML adapter for Java types. A subclass can
      * enable parsing of the value string as containing XML text via the
      * setParseStringAsXML() method and then override getStringValue() to return a
      * String containing the custom formatted XML.
-     *
      */
     protected String getStringValue() {
-        return (String)getPropertyValue().toString();
+        return (String) getPropertyValue().toString();
     }
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    protected List buildChildAdapters()
-    {
+    protected List buildChildAdapters() {
         Node node;
-        if ( getParseStringAsXML() ) {
-            log.debug( "parsing string as xml: " + getStringValue() );
+        if (getParseStringAsXML()) {
+            log.debug("parsing string as xml: " + getStringValue());
             // Parse the String to a DOM, then proxy that as our child
             try {
-                node = XMLUtils.parse( getStringValue() );
-            } catch ( ParserConfigurationException e ) {
-                throw new WebWorkException( e );
-            } catch ( IOException e ) {
-                throw new WebWorkException( e );
-            } catch ( SAXException e ) {
-                throw new WebWorkException( e );
+                node = XMLUtils.parse(getStringValue());
+            } catch (ParserConfigurationException e) {
+                throw new WebWorkException(e);
+            } catch (IOException e) {
+                throw new WebWorkException(e);
+            } catch (SAXException e) {
+                throw new WebWorkException(e);
             }
-            node = getAdapterFactory().proxyNode( this, node );
-        } else
-        {
-            log.debug( "using string as is: " + getStringValue() );
+            node = getAdapterFactory().proxyNode(this, node);
+        } else {
+            log.debug("using string as is: " + getStringValue());
             // Create a Text node as our child
-            node = new SimpleTextNode( getAdapterFactory(), this, "text", getStringValue() );
+            node = new SimpleTextNode(getAdapterFactory(), this, "text", getStringValue());
         }
 
         List children = new ArrayList();
-        children.add( node );
+        children.add(node);
         return children;
     }
 
     /**
      * Is this StringAdapter to interpret its string values as containing
      * XML Text?
+     *
      * @see #setParseStringAsXML(boolean)
      */
     public boolean getParseStringAsXML() {
         return parseStringAsXML;
     }
+
     /**
      * When set to true the StringAdapter will interpret its String value
      * as containing XML text and parse it to a DOM Element.  The new DOM
      * Element will be a child of this String element. (i.e. wrapped in an
      * element of the property name specified for this StringAdapter).
-     * @param parseStringAsXML
      *
+     * @param parseStringAsXML
      * @see #getParseStringAsXML()
      */
-    public void setParseStringAsXML( boolean parseStringAsXML ) {
+    public void setParseStringAsXML(boolean parseStringAsXML) {
         this.parseStringAsXML = parseStringAsXML;
     }