cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/arch/config ConfigurationException.java ConfigurationImpl.java SAXConfigurationBuilder.java AbstractConfiguration.java Configurable.java Configuration.java XMLConfiguration.java
Date Sun, 27 Feb 2000 01:19:58 GMT
pier        00/02/26 17:19:58

  Modified:    src/org/apache/arch/config Tag: xml-cocoon2
                        AbstractConfiguration.java Configurable.java
                        Configuration.java
  Added:       src/org/apache/arch/config Tag: xml-cocoon2
                        ConfigurationException.java ConfigurationImpl.java
                        SAXConfigurationBuilder.java
  Removed:     src/org/apache/arch/config Tag: xml-cocoon2
                        XMLConfiguration.java
  Log:
  [Cocoon 2.0] modified avalon configuration classes
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +295 -23   xml-cocoon/src/org/apache/arch/config/Attic/AbstractConfiguration.java
  
  Index: AbstractConfiguration.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/arch/config/Attic/AbstractConfiguration.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- AbstractConfiguration.java	1999/12/11 23:28:47	1.1.2.1
  +++ AbstractConfiguration.java	2000/02/27 01:19:56	1.1.2.2
  @@ -1,54 +1,326 @@
   /*****************************************************************************
  - * Copyright (C) $YEAR$ The Apache Software Foundation. All rights reserved. *
  + * Copyright (C) The Apache Software Foundation. All rights reserved.        *
    * ------------------------------------------------------------------------- *
    * This software is published under the terms of the Apache Software License *
    * version 1.1, a copy of which has been included  with this distribution in *
    * the LICENSE file.                                                         *
    *****************************************************************************/
  -
   package org.apache.arch.config;
   
  +import java.util.Enumeration;
  +
   /**
  - * This is an abstract implementation that deals with 
  - * methods that can be abstracted away from underlying implementations.
  + * This is an abstract <code>Configuration</code> implementation that deals
  + * with methods that can be abstracted away from underlying implementations.
    *
    * @author <a href="mailto:scoobie@betaversion.org">Federico Barbieri</a>
  - * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
  - * @version $Revision: 1.1.2.1 $ $Date: 1999/12/11 23:28:47 $
  + *         (Betaversion Productions)
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  + *         (Apache Software Foundation)
  + * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
  + *         (Apache Software Foundation, Exoffice Technologies)
  + * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/02/27 01:19:56 $
    */
  -
   public abstract class AbstractConfiguration implements Configuration {
  +    /**
  +     * The location string containing information about this
  +     * <code>Configuration</code> location in the source file.
  +     */
  +    protected String location=null;
       
  -    public int getValueAsInt() {
  -        return Integer.parseInt(getValue());
  +    /**
  +     * Construct a new <code>AbstractConfiguration</code> instance.
  +     */
  +    protected AbstractConfiguration() {
  +        this(null,-1);
       }
   
  -    public long getValueAsLong() {
  -        return Long.parseLong(getValue());
  +    /**
  +     * Construct a new <code>AbstractConfiguration</code> instance.
  +     */
  +    protected AbstractConfiguration(String source, int line) {
  +        super();
  +        this.location="";
  +        if (source!=null) this.location=source;
  +        if ((line>=0)&&(this.location.length()>0)) this.location+=" ";
  +        if (line>0) this.location+="line "+line;
  +        if (this.location.length()>0) this.location="("+this.location+")";
  +        else this.location=null;
       }
  +
  +    /**
  +     * Returns the value of the configuration element as an <code>int</code>.
  +     */
  +    public int getValueAsInt()
  +	throws ConfigurationException {
  +        String value=this.getValue();
  +        try {
  +            if (value.startsWith("0x"))
  +                return(Integer.parseInt(value.substring(2),16));
  +            else if (value.startsWith("0o"))
  +                return(Integer.parseInt(value.substring(2),8));
  +            else if (value.startsWith("0b"))
  +                return(Integer.parseInt(value.substring(2),2));
  +            else return(Integer.parseInt(value));
  +        } catch (NumberFormatException e) {
  +            throw new ConfigurationException("Cannot parse the value of the "+
  +                "configuration element \""+this.getName()+"\" as an integer",
  +                this);
  +        }
  +	}
   
  -    public float getValueAsFloat() {
  -        return Float.valueOf(getValue()).floatValue();
  +    /**
  +     * Returns the value of the configuration element as a <code>long</code>.
  +     */
  +    public long getValueAsLong()
  +	throws ConfigurationException {
  +        String value=this.getValue();
  +        try {
  +            if (value.startsWith("0x"))
  +                return(Long.parseLong(value.substring(2),16));
  +            else if (value.startsWith("0o"))
  +                return(Long.parseLong(value.substring(2),8));
  +            else if (value.startsWith("0b"))
  +                return(Long.parseLong(value.substring(2),2));
  +            else return(Integer.parseInt(value));
  +        } catch (NumberFormatException e) {
  +            throw new ConfigurationException("Cannot parse the value of the "+
  +                "configuration element \""+this.getName()+"\" as a long", this);
  +        }
  +	}
  +
  +    /**
  +     * Returns the value of the configuration element as a <code>float</code>.
  +     */
  +    public float getValueAsFloat()
  +	throws ConfigurationException {
  +        String value=this.getValue();
  +        try {
  +            return(Float.parseFloat(value));
  +        } catch (NumberFormatException e) {
  +            throw new ConfigurationException("Cannot parse the value of the "+
  +                "configuration element \""+this.getName()+"\" as a float",
  +                this);
  +        }
       }
   
  -    public boolean getValueAsBoolean() {
  -        return "true".equals(getValue().toLowerCase());
  +    /**
  +     * Returns the value of the configuration element as a <code>boolean</code>.
  +     */
  +    public boolean getValueAsBoolean()
  +	throws ConfigurationException {
  +        String value=this.getValue();
  +        if (value.equals("true")) return(true);
  +        if (value.equals("false")) return(false);
  +        throw new ConfigurationException("Cannot parse the value of the "+
  +            "configuration element \""+this.getName()+"\" as a boolean",
  +            this);
       }
       
  -    public int getAttributeAsInt(String name){
  -        return Integer.parseInt(getAttribute(name));
  +    /**
  +     * Returns the value of the configuration element as a <code>String</code>.
  +     */
  +    public String getValue(String defaultValue) {
  +        try {
  +            return(this.getValue());
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
  +    }
  +
  +    /**
  +     * Returns the value of the configuration element as an <code>int</code>.
  +     */
  +    public int getValueAsInt(int defaultValue) {
  +        try {
  +            return(this.getValueAsInt());
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
       }
   
  -    public long getAttributeAsLong(String name) {
  -        return Long.parseLong(getAttribute(name));
  +    /**
  +     * Returns the value of the configuration element as a <code>long</code>.
  +     */
  +    public long getValueAsLong(long defaultValue) {
  +        try {
  +            return(this.getValueAsLong());
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
       }
   
  -    public float getAttributeAsFloat(String name) {
  -        return Float.valueOf(getAttribute(name)).floatValue();
  +    /**
  +     * Returns the value of the configuration element as a <code>float</code>.
  +     */
  +    public float getValueAsFloat(float defaultValue) {
  +        try {
  +            return(this.getValueAsFloat());
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
       }
   
  -    public boolean getAttributeAsBoolean(String name) {
  -        return "true".equals(getAttribute(name).toLowerCase());
  +    /**
  +     * Returns the value of the configuration element as a <code>boolean</code>.
  +     */
  +    public boolean getValueAsBoolean(boolean defaultValue) {
  +        try {
  +            return(this.getValueAsBoolean());
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
       }
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as an
  +     * <code>int</code>.
  +     */
  +    public int getAttributeAsInt(String name)
  +	throws ConfigurationException {
  +        String value=this.getAttribute(name);
  +        try {
  +            if (value.startsWith("0x"))
  +                return(Integer.parseInt(value.substring(2),16));
  +            else if (value.startsWith("0o"))
  +                return(Integer.parseInt(value.substring(2),8));
  +            else if (value.startsWith("0b"))
  +                return(Integer.parseInt(value.substring(2),2));
  +            else return(Integer.parseInt(value));
  +        } catch (NumberFormatException e) {
  +            throw new ConfigurationException("Cannot parse the value of the "+
  +                "attribute \""+name+"\" of the configuration element \""+
  +                this.getName()+"\" as an integer",this);
  +        }
  +    }
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>long</code>.
  +     */
  +    public long getAttributeAsLong(String name)
  +	throws ConfigurationException {
  +        String value=this.getAttribute(name);
  +        try {
  +            if (value.startsWith("0x"))
  +                return(Long.parseLong(value.substring(2),16));
  +            else if (value.startsWith("0o"))
  +                return(Long.parseLong(value.substring(2),8));
  +            else if (value.startsWith("0b"))
  +                return(Long.parseLong(value.substring(2),2));
  +            else return(Integer.parseInt(value));
  +        } catch (NumberFormatException e) {
  +            throw new ConfigurationException("Cannot parse the value of the "+
  +                "attribute \""+name+"\" of the configuration element \""+
  +                this.getName()+"\" as a long", this);
  +        }
  +    }
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>float</code>.
  +     */
  +    public float getAttributeAsFloat(String name)
  +	throws ConfigurationException {
  +        String value=this.getAttribute(name);
  +        try {
  +            return(Float.parseFloat(value));
  +        } catch (NumberFormatException e) {
  +            throw new ConfigurationException("Cannot parse the value of the "+
  +                "attribute \""+name+"\" of the configuration element \""+
  +                this.getName()+"\" as a float", this);
  +        }
  +    }
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>boolean</code>.
  +     */
  +    public boolean getAttributeAsBoolean(String name)
  +	throws ConfigurationException {
  +        String value=this.getAttribute(name);
  +        if (value.equals("true")) return(true);
  +        if (value.equals("false")) return(false);
  +        throw new ConfigurationException("Cannot parse the value of the "+
  +            "attribute \""+name+"\" of the configuration element \""+
  +            this.getName()+"\" as a boolean", this);
  +    }
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>String</code>.
  +     */
  +    public String getAttribute(String name, String defaultValue) {
  +        try {
  +            return(this.getAttribute(name));
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
  +    }
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as an
  +     * <code>int</code>.
  +     */
  +    public int getAttributeAsInt(String name, int defaultValue) {
  +        try {
  +            return(this.getAttributeAsInt(name));
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
  +    }
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>long</code>.
  +     */
  +    public long getAttributeAsLong(String name, long defaultValue) {
  +        try {
  +            return(this.getAttributeAsLong(name));
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
  +    }
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>float</code>.
  +     */
  +    public float getAttributeAsFloat(String name, float defaultValue) {
  +        try {
  +            return(this.getAttributeAsFloat(name));
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
  +    }
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>boolean</code>.
  +     */
  +    public boolean getAttributeAsBoolean(String name, boolean defaultValue) {
  +        try {
  +            return(this.getAttributeAsBoolean(name));
  +        } catch (ConfigurationException e) {
  +            return(defaultValue);
  +        }
  +    }
  +
  +    /**
  +     * Return the first <code>Configuration</code> object child of this
  +     * associated with the given name.
  +     */
  +    public Configuration getConfiguration(String name) {
  +	    Enumeration e=this.getConfigurations(name);
  +	    if (e.hasMoreElements()) return((Configuration)e.nextElement());
  +        return(null);
  +	}
  +
  +	/**
  +	 * Return a <code>String</code> indicating the position of this
  +	 * configuration element in a source file or URI or <b>null</b>.
  +	 */
  +	public String getLocation() {
  +	    return(this.location);
  +	}
   }
  
  
  
  1.1.2.2   +14 -13    xml-cocoon/src/org/apache/arch/config/Attic/Configurable.java
  
  Index: Configurable.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/arch/config/Attic/Configurable.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Configurable.java	1999/12/11 23:28:47	1.1.2.1
  +++ Configurable.java	2000/02/27 01:19:57	1.1.2.2
  @@ -5,7 +5,6 @@
    * version 1.1, a copy of which has been included  with this distribution in *
    * the LICENSE file.                                                         *
    *****************************************************************************/
  -
   package org.apache.arch.config;
   
   /**
  @@ -13,23 +12,25 @@
    * configured with custom parameters before initialization. 
    *
    * @author <a href="mailto:scoobie@betaversion.org">Federico Barbieri</a>
  - * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
  + *         (Betaversion Productions)
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.1.2.1 $ $Date: 1999/12/11 23:28:47 $
  + *         (Apache Software Foundation)
  + * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
  + *         (Apache Software Foundation, Exoffice Technologies)
  + * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/02/27 01:19:57 $
    */
  -
   public interface Configurable {
       
       /**
  -     * Pass the configurations to the configurable class. This method
  -     * is always called after the constructor and before any other
  -     * method.
  +     * Pass a <code>Configuration</code> instance to this
  +     * <code>Configurable</code> class. This method is always called after
the
  +     * constructor and before any other method.
        *
  -     * @param conf the class configurations.
  -     * @exception if a required Configuration is not found, this method
  -     * should throw an <code>IllegalArgumentException</code> indicating
  -     * the cause of such failure.
  +     * @param conf The <code>Configuration</code> instance.
  +     * @exception ConfigurationException If the given <code>Configuration</code>
  +     *                                   is not valid or doesn't contain the
  +     *                                   proper configuration data.
        */
  -     void setConfiguration(Configuration conf);
  -    
  +     public void setConfiguration(Configuration conf)
  +     throws ConfigurationException;
   }
  
  
  
  1.1.2.2   +187 -89   xml-cocoon/src/org/apache/arch/config/Attic/Configuration.java
  
  Index: Configuration.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/arch/config/Attic/Configuration.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Configuration.java	1999/12/11 23:28:48	1.1.2.1
  +++ Configuration.java	2000/02/27 01:19:57	1.1.2.2
  @@ -5,7 +5,6 @@
    * version 1.1, a copy of which has been included  with this distribution in *
    * the LICENSE file.                                                         *
    *****************************************************************************/
  -
   package org.apache.arch.config;
   
   import java.util.Enumeration;
  @@ -15,108 +14,207 @@
    * configuration repository used by <code>Configurable</code> classes.
    *
    * @author <a href="mailto:scoobie@betaversion.org">Federico Barbieri</a>
  - * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
  + *         (Betaversion Productions)
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.1.2.1 $ $Date: 1999/12/11 23:28:48 $
  + *         (Apache Software Foundation)
  + * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
  + *         (Apache Software Foundation, Exoffice Technologies)
  + * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/02/27 01:19:57 $
    */
  - 
   public interface Configuration {
   
  -    /*
  -     * Returns the name of the root configuration element.
  +    /**
  +     * Returns the name of this configuration element.
        */
  -	String getName();
  -	
  -    /*
  -     * Returns the value of the configuration element as String.
  -     * @exception IllegalStateException if value is not present.
  +	public String getName();
  +
  +    /**
  +     * Returns the value of the configuration element as a <code>String</code>.
  +     *
  +     * @exception ConfigurationException If the value is not present.
  +     */
  +	public String getValue()
  +	throws ConfigurationException;
  +
  +    /**
  +     * Returns the value of the configuration element as an <code>int</code>.
  +     *
  +     * @exception ConfigurationException If the value is not present or it
  +     *                                   cannot be represented as an
  +     *                                   <code>int</code>.
  +     */
  +    public int getValueAsInt()
  +	throws ConfigurationException;
  +
  +    /**
  +     * Returns the value of the configuration element as a <code>long</code>.
  +     *
  +     * @exception ConfigurationException If the value is not present or it
  +     *                                   cannot be represented as a
  +     *                                   <code>long</code>.
  +     */
  +    public long getValueAsLong()
  +	throws ConfigurationException;
  +
  +    /**
  +     * Returns the value of the configuration element as a <code>float</code>.
  +     *
  +     * @exception ConfigurationException If the value is not present or it
  +     *                                   cannot be represented as a
  +     *                                   <code>float</code>.
  +     */
  +    public float getValueAsFloat()
  +	throws ConfigurationException;
  +
  +    /**
  +     * Returns the value of the configuration element as a <code>boolean</code>.
  +     * <br>
  +     * This method returns <b>true</b> if the value of the this configuration
  +     * element equals the lowered-case <code>String</code> &quot;true&quot;,
  +     * <b>false</b> if it equals the lowered-case <code>String</code>
  +     * &quot;false&quot;, or it throws a <code>ConfigurationException</code>.
  +     *
  +     * @exception ConfigurationException If the value is not present or it
  +     *                                   cannot be represented as a
  +     *                                   <code>boolean</code>.
  +     */
  +    public boolean getValueAsBoolean()
  +	throws ConfigurationException;
  +    
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>String</code>.
  +     *
  +     * @exception ConfigurationException If the attribute is not present.
  +     */
  +	public String getAttribute(String name)
  +	throws ConfigurationException;
  +    
  +    /**
  +     * Returns the value of the attribute specified by its name as an
  +     * <code>int</code>.
  +     *
  +     * @exception ConfigurationException If the attribute is not present or
  +     *                                   its value cannot be represented as an
  +     *                                   <code>int</code>.
  +     */
  +    public int getAttributeAsInt(String name)
  +	throws ConfigurationException;
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>long</code>.
  +     *
  +     * @exception ConfigurationException If the attribute is not present or
  +     *                                   its value cannot be represented as a
  +     *                                   <code>long</code>.
  +     */
  +    public long getAttributeAsLong(String name)
  +	throws ConfigurationException;
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>float</code>.
  +     *
  +     * @exception ConfigurationException If the attribute is not present or
  +     *                                   its value cannot be represented as a
  +     *                                   <code>float</code>.
  +     */
  +    public float getAttributeAsFloat(String name)
  +	throws ConfigurationException;
  +
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>boolean</code>.
  +     * <br>
  +     * This method returns <b>true</b> if the value of the the specified
  +     * attribute equals the lowered-case <code>String</code> &quot;true&quot;,
  +     * <b>false</b> if it equals the lowered-case <code>String</code>
  +     * &quot;false&quot;, or it throws a <code>ConfigurationException</code>.
  +     *
  +     * @exception ConfigurationException If the attribute is not present or
  +     *                                   its value cannot be represented as a
  +     *                                   <code>boolean</code>.
  +     */
  +    public boolean getAttributeAsBoolean(String name)
  +	throws ConfigurationException;
  +
  +    /**
  +     * Returns the value of the configuration element as a <code>String</code>.
  +     */
  +	public String getValue(String defaultValue);
  +
  +    /**
  +     * Returns the value of the configuration element as an <code>int</code>.
  +     */
  +    public int getValueAsInt(int defaultValue);
  +
  +    /**
  +     * Returns the value of the configuration element as a <code>long</code>.
  +     */
  +    public long getValueAsLong(long defaultValue);
  +
  +    /**
  +     * Returns the value of the configuration element as a <code>float</code>.
        */
  -	String getValue();
  +    public float getValueAsFloat(float defaultValue);
   
  -    /*
  -     * Returns the value of the configuration element as int.
  -     * @exception IllegalStateException if value is not present.
  -     * @excpetion NumberFormatException if the value cannot be parsed as int.
  +    /**
  +     * Returns the value of the configuration element as a <code>boolean</code>.
  +     */
  +    public boolean getValueAsBoolean(boolean defaultValue);
  +    
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>String</code>.
  +     */
  +	public String getAttribute(String name, String defaultValue);
  +    
  +    /**
  +     * Returns the value of the attribute specified by its name as an
  +     * <code>int</code>.
        */
  -    int getValueAsInt();
  +    public int getAttributeAsInt(String name, int defaultValue);
   
  -    /*
  -     * Returns the value of the configuration element as long.
  -     * @exception IllegalStateException if value is not present.
  -     * @excpetion NumberFormatException if the value cannot be parsed as long.
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>long</code>.
        */
  -    long getValueAsLong();
  +    public long getAttributeAsLong(String name, long defaultValue);
   
  -    /*
  -     * Returns the value of the configuration element as float.
  -     * @exception IllegalStateException if value is not present.
  -     * @excpetion NumberFormatException if the value cannot be parsed as float.
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>float</code>.
        */
  -    float getValueAsFloat();
  +    public float getAttributeAsFloat(String name, float defaultValue);
   
  -    /*
  -     * Returns the value of the configuration element as boolean,
  -     * returning "true" if the lowered-cased value is the string "true", false
  -     * otherwise.
  -     * @exception IllegalStateException if value is not present.
  +    /**
  +     * Returns the value of the attribute specified by its name as a
  +     * <code>boolean</code>.
        */
  -    boolean getValueAsBoolean();
  -    
  -    /*
  -     * Returns the value of the attribute with the given name as String.
  -     * @exception IllegalStateException if value is not present.
  +    public boolean getAttributeAsBoolean(String name, boolean defaultValue);
  +
  +    /**
  +     * Return the first <code>Configuration</code> object child of this
  +     * associated with the given name or <b>null</b>.
  +     *
  +     * @param name The name of the required child <code>Configuration</code>.
        */
  -	String getAttribute(String name);
  -    
  -    /*
  -     * Returns the value of the attribute with the given name as int.
  -     * @exception IllegalStateException if value is not present.
  -     * @excpetion NumberFormatException if the value cannot be parsed as int.
  -     */
  -    int getAttributeAsInt(String name);
  -
  -    /*
  -     * Returns the value of the attribute with the given name as long.
  -     * @exception IllegalStateException if value is not present.
  -     * @excpetion NumberFormatException if the value cannot be parsed as long.
  -     */
  -    long getAttributeAsLong(String name);
  -
  -    /*
  -     * Returns the value of the attribute with the given name as float.
  -     * @exception IllegalStateException if value is not present.
  -     * @excpetion NumberFormatException if the value cannot be parsed as float.
  -     */
  -    float getAttributeAsFloat(String name);
  -
  -    /*
  -     * Returns the value of the attribute with the given name as boolean, 
  -     * returning "true" if the lowered-cased value is the string "true", false
  -     * otherwise.
  -     * @exception IllegalStateException if value is not present.
  -     */
  -    boolean getAttributeAsBoolean(String name);
  -
  -    /*
  -     * Return the Configuration object associated with the given
  -     * name.
  -     * @param name the name of the required configuration using the 
  -     * absolute path of the format "/path/name".
  -     * @exception IllegalArgumentException no configuration is found
  -     * for the given name.
  -     * @exception IllegalStateException more than one configuration is found
  -     * for the given name. (in this case, the method getConfigurations() should
  -     * be called instead)
  -     */
  -    Configuration getConfiguration(String name);
  -
  -    /*
  -     * Return an Enumeration of <code>Configuration</code> objects
  -     * associated with the given name.
  -     * @param name the name of the required configurations using the 
  -     * absolute path of the format "/path/name".
  -     * @exception IllegalArgumentException no configuration is found
  -     * for the given name.
  +    public Configuration getConfiguration(String name);
  +
  +    /**
  +     * Return an <code>Enumeration</code> of <code>Configuration</code>
objects
  +     * children of this associated with the given name.
  +     * <br>
  +     * The returned <code>Enumeration</code> may be empty.
  +     *
  +     * @param name The name of the required children <code>Configuration</code>.
        */
  -	Enumeration getConfigurations(String name);
  +	public Enumeration getConfigurations(String name);
  +	
  +	/**
  +	 * Return a <code>String</code> indicating the position of this
  +	 * configuration element in a source file or URI or <b>null</b>.
  +	 */
  +	public String getLocation();
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +56 -0     xml-cocoon/src/org/apache/arch/config/Attic/ConfigurationException.java
  
  
  
  
  1.1.2.1   +154 -0    xml-cocoon/src/org/apache/arch/config/Attic/ConfigurationImpl.java
  
  
  
  
  1.1.2.1   +223 -0    xml-cocoon/src/org/apache/arch/config/Attic/SAXConfigurationBuilder.java
  
  
  
  

Mime
View raw message