commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmi...@apache.org
Subject cvs commit: jakarta-commons/jxpath/src/java/org/apache/commons/jxpath XMLDocumentContainer.java Variables.java
Date Wed, 24 Apr 2002 03:30:17 GMT
dmitri      02/04/23 20:30:17

  Modified:    jxpath/src/java/org/apache/commons/jxpath
                        XMLDocumentContainer.java Variables.java
  Log:
  Improved formatting
  
  Revision  Changes    Path
  1.3       +21 -10    jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java
  
  Index: XMLDocumentContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLDocumentContainer.java	11 Apr 2002 03:00:11 -0000	1.2
  +++ XMLDocumentContainer.java	24 Apr 2002 03:30:17 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java,v
1.2 2002/04/11 03:00:11 dmitri Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/04/11 03:00:11 $
  + * $Header: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java,v
1.3 2002/04/24 03:30:17 dmitri Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/24 03:30:17 $
    *
    * ====================================================================
    * The Apache Software License, Version 1.1
  @@ -61,15 +61,16 @@
    */
   package org.apache.commons.jxpath;
   
  -import java.util.*;
  +import java.io.InputStream;
  +import java.net.URL;
  +
   import javax.xml.transform.Source;
   import javax.xml.transform.Transformer;
   import javax.xml.transform.TransformerFactory;
  -import javax.xml.transform.stream.StreamSource;
   import javax.xml.transform.dom.DOMResult;
  -import java.net.URL;
  -import org.w3c.dom.*;
  -import java.io.InputStream;
  +import javax.xml.transform.stream.StreamSource;
  +import org.w3c.dom.Document;
  +import org.w3c.dom.Node;
   
   /**
    * An XML document container reads and parses XML only when it is
  @@ -82,7 +83,7 @@
    * read at all.
    *
    * @author Dmitri Plotnikov
  - * @version $Revision: 1.2 $ $Date: 2002/04/11 03:00:11 $
  + * @version $Revision: 1.3 $ $Date: 2002/04/24 03:30:17 $
    */
   public class XMLDocumentContainer implements Container {
   
  @@ -90,6 +91,10 @@
       private URL xmlURL;
       private Source source;
   
  +    /**
  +     * @param URL is a URL for an XML file. Use getClass().getResource(resourceName)
  +     * to load XML from a resource file.
  +     */
       public XMLDocumentContainer(URL xmlURL){
           this.xmlURL = xmlURL;
           if (xmlURL == null){
  @@ -104,6 +109,9 @@
           }
       }
   
  +    /**
  +     * Reads XML, caches it internally and returns the Document.
  +     */
       public Object getValue(){
           if (document == null){
               try {
  @@ -116,7 +124,7 @@
                       DOMResult result = new DOMResult();
                       Transformer trans = TransformerFactory.newInstance().newTransformer();
                       trans.transform(source, result);
  -                    document = (Document)result.getNode();
  +                    document = (Document) result.getNode();
                   }
                   finally {
                       if (stream != null){
  @@ -133,6 +141,9 @@
           return document;
       }
   
  +    /**
  +     * Throws an UnsupportedOperationException
  +     */
       public void setValue(Object value){
           throw new UnsupportedOperationException();
       }
  
  
  
  1.2       +3 -5      jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/Variables.java
  
  Index: Variables.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/Variables.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Variables.java	23 Aug 2001 00:46:58 -0000	1.1
  +++ Variables.java	24 Apr 2002 03:30:17 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/Variables.java,v
1.1 2001/08/23 00:46:58 dmitri Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/08/23 00:46:58 $
  + * $Header: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/Variables.java,v
1.2 2002/04/24 03:30:17 dmitri Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/24 03:30:17 $
    *
    * ====================================================================
    * The Apache Software License, Version 1.1
  @@ -61,8 +61,6 @@
    */
   package org.apache.commons.jxpath;
   
  -import java.util.*;
  -
   /**
    * Variables provide access to a global set of values accessible via XPath.
    * XPath can reference variables using the "$varname" syntax. To use a custom
  @@ -72,7 +70,7 @@
    * @see JXPathContext#setVariables
    *
    * @author Dmitri Plotnikov
  - * @version $Revision: 1.1 $ $Date: 2001/08/23 00:46:58 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/24 03:30:17 $
    */
   public interface Variables {
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message