CVS: plexus-container-new/src/java/org/apache/plexus/configuration DefaultConfiguration.java,1.1.1.1,1.2
[email protected] Sat, 31 May 2003 13:20:28 -0500
| Newsgroups | gmane.comp.java.plexus.devel |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/configuration
In directory eng.werken.com:/tmp/cvs-serv23337
Modified Files:
DefaultConfiguration.java
Log Message:
o Getting rid of m_ and final.
Index: DefaultConfiguration.java
===================================================================
RCS file: /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/configuration/DefaultConfiguration.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- DefaultConfiguration.java 29 Mar 2003 03:49:44 -0000 1.1.1.1
+++ DefaultConfiguration.java 31 May 2003 18:20:26 -0000 1.2
@@ -76,20 +76,20 @@
*/
protected static final Configuration[] EMPTY_ARRAY = new Configuration[0];
- private final String m_name;
- private final String m_location;
- private final String m_namespace;
- private final String m_prefix;
- private HashMap m_attributes;
- private ArrayList m_children;
- private String m_value;
- private boolean m_readOnly;
+ private final String name;
+ private final String location;
+ private final String namespace;
+ private final String prefix;
+ private HashMap attributes;
+ private ArrayList children;
+ private String value;
+ private boolean readOnly;
/**
* Create a new <code>DefaultConfiguration</code> instance.
* @param name a <code>String</code> value
*/
- public DefaultConfiguration( final String name )
+ public DefaultConfiguration( String name )
{
this( name, null, "", "" );
}
@@ -99,7 +99,7 @@
* @param name a <code>String</code> value
* @param location a <code>String</code> value
*/
- public DefaultConfiguration( final String name, final String location )
+ public DefaultConfiguration( String name, String location )
{
this( name, location, "", "" );
}
@@ -115,15 +115,15 @@
* namespace.
* @since 4.1
*/
- public DefaultConfiguration( final String name,
- final String location,
- final String ns,
- final String prefix )
+ public DefaultConfiguration( String name,
+ String location,
+ String ns,
+ String prefix )
{
- m_name = name;
- m_location = location;
- m_namespace = ns;
- m_prefix = prefix; // only used as a serialization hint. Cannot be null
+ this.name = name;
+ this.location = location;
+ this.namespace = ns;
+ this.prefix = prefix; // only used as a serialization hint. Cannot be null
}
/**
@@ -132,7 +132,7 @@
*/
public String getName()
{
- return m_name;
+ return name;
}
/**
@@ -143,9 +143,9 @@
*/
public String getNamespace() throws ConfigurationException
{
- if ( null != m_namespace )
+ if ( null != namespace )
{
- return m_namespace;
+ return namespace;
}
else
{
@@ -164,9 +164,9 @@
*/
protected String getPrefix() throws ConfigurationException
{
- if ( null != m_prefix )
+ if ( null != prefix )
{
- return m_prefix;
+ return prefix;
}
else
{
@@ -184,7 +184,7 @@
*/
public String getLocation()
{
- return m_location;
+ return location;
}
/**
@@ -193,11 +193,11 @@
* @param defaultValue the default value to return if value malformed or empty
* @return a <code>String</code> value
*/
- public String getValue( final String defaultValue )
+ public String getValue( String defaultValue )
{
- if ( null != m_value )
+ if ( null != value )
{
- return m_value;
+ return value;
}
else
{
@@ -213,9 +213,9 @@
*/
public String getValue() throws ConfigurationException
{
- if ( null != m_value )
+ if ( null != value )
{
- return m_value;
+ return value;
}
else
{
@@ -231,13 +231,13 @@
*/
public String[] getAttributeNames()
{
- if ( null == m_attributes )
+ if ( null == attributes )
{
return new String[0];
}
else
{
- return (String[]) m_attributes.keySet().toArray( new String[0] );
+ return (String[]) attributes.keySet().toArray( new String[0] );
}
}
@@ -249,13 +249,13 @@
*/
public Configuration[] getChildren()
{
- if ( null == m_children )
+ if ( null == children )
{
return new Configuration[0];
}
else
{
- return (Configuration[]) m_children.toArray( new Configuration[0] );
+ return (Configuration[]) children.toArray( new Configuration[0] );
}
}
@@ -267,11 +267,11 @@
* @return a <code>String</code> value
* @throws org.apache.avalon.framework.configuration.ConfigurationException If the attribute is not present.
*/
- public String getAttribute( final String name )
+ public String getAttribute( String name )
throws ConfigurationException
{
- final String value =
- ( null != m_attributes ) ? (String) m_attributes.get( name ) : null;
+ String value =
+ ( null != attributes ) ? (String) attributes.get( name ) : null;
if ( null != value )
{
@@ -293,14 +293,14 @@
* @param createNew a <code>boolean</code> value
* @return a <code>Configuration</code> value
*/
- public Configuration getChild( final String name, final boolean createNew )
+ public Configuration getChild( String name, boolean createNew )
{
- if ( null != m_children )
+ if ( null != children )
{
- final int size = m_children.size();
+ int size = children.size();
for ( int i = 0; i < size; i++ )
{
- final Configuration configuration = (Configuration) m_children.get( i );
+ Configuration configuration = (Configuration) children.get( i );
if ( name.equals( configuration.getName() ) )
{
return configuration;
@@ -327,20 +327,20 @@
* @param name The name of the required children <code>Configuration</code>.
* @return a <code>Configuration[]</code> value
*/
- public Configuration[] getChildren( final String name )
+ public Configuration[] getChildren( String name )
{
- if ( null == m_children )
+ if ( null == children )
{
return new Configuration[0];
}
else
{
- final ArrayList children = new ArrayList();
- final int size = m_children.size();
+ ArrayList children = new ArrayList();
+ int size = this.children.size();
for ( int i = 0; i < size; i++ )
{
- final Configuration configuration = (Configuration) m_children.get( i );
+ Configuration configuration = (Configuration) this.children.get( i );
if ( name.equals( configuration.getName() ) )
{
children.add( configuration );
@@ -357,17 +357,17 @@
* @param value a <code>String</code> value
* @deprecated Use setValue() instead
*/
- public void appendValueData( final String value )
+ public void appendValueData( String value )
{
checkWriteable();
- if ( null == m_value )
+ if ( null == this.value )
{
- m_value = value;
+ this.value = value;
}
else
{
- m_value += value;
+ this.value += value;
}
}
@@ -376,11 +376,11 @@
*
* @param value a <code>String</code> value
*/
- public void setValue( final String value )
+ public void setValue( String value )
{
checkWriteable();
- m_value = value;
+ this.value = value;
}
/**
@@ -389,15 +389,15 @@
* @param name name of the attribute to set
* @param value a <code>String</code> value
*/
- public void setAttribute( final String name, final String value )
+ public void setAttribute( String name, String value )
{
checkWriteable();
- if ( null == m_attributes )
+ if ( null == attributes )
{
- m_attributes = new HashMap();
+ attributes = new HashMap();
}
- m_attributes.put( name, value );
+ attributes.put( name, value );
}
/**
@@ -409,32 +409,32 @@
* @return a <code>String</code> value
* @deprecated Use setAttribute() instead
*/
- public String addAttribute( final String name, String value )
+ public String addAttribute( String name, String value )
{
checkWriteable();
- if ( null == m_attributes )
+ if ( null == attributes )
{
- m_attributes = new HashMap();
+ attributes = new HashMap();
}
- return (String) m_attributes.put( name, value );
+ return (String) attributes.put( name, value );
}
/**
* Add a child <code>Configuration</code> to this configuration element.
* @param configuration a <code>Configuration</code> value
*/
- public void addChild( final Configuration configuration )
+ public void addChild( Configuration configuration )
{
checkWriteable();
- if ( null == m_children )
+ if ( null == children )
{
- m_children = new ArrayList();
+ children = new ArrayList();
}
- m_children.add( configuration );
+ children.add( configuration );
}
/**
@@ -444,7 +444,7 @@
*
* @param other the {@link org.apache.avalon.framework.configuration.Configuration} element
*/
- public void addAll( final Configuration other )
+ public void addAll( Configuration other )
{
checkWriteable();
@@ -459,15 +459,15 @@
*
* @param other the {@link org.apache.avalon.framework.configuration.Configuration} element
*/
- public void addAllAttributes( final Configuration other )
+ public void addAllAttributes( Configuration other )
{
checkWriteable();
- final String[] attributes = other.getAttributeNames();
+ String[] attributes = other.getAttributeNames();
for ( int i = 0; i < attributes.length; i++ )
{
- final String name = attributes[i];
- final String value = other.getAttribute( name, null );
+ String name = attributes[i];
+ String value = other.getAttribute( name, null );
setAttribute( name, value );
}
}
@@ -478,11 +478,11 @@
*
* @param other the other {@link org.apache.avalon.framework.configuration.Configuration} value
*/
- public void addAllChildren( final Configuration other )
+ public void addAllChildren( Configuration other )
{
checkWriteable();
- final Configuration[] children = other.getChildren();
+ Configuration[] children = other.getChildren();
for ( int i = 0; i < children.length; i++ )
{
addChild( children[i] );
@@ -493,15 +493,15 @@
* Remove a child <code>Configuration</code> to this configuration element.
* @param configuration a <code>Configuration</code> value
*/
- public void removeChild( final Configuration configuration )
+ public void removeChild( Configuration configuration )
{
checkWriteable();
- if ( null == m_children )
+ if ( null == children )
{
return;
}
- m_children.remove( configuration );
+ children.remove( configuration );
}
/**
@@ -510,12 +510,12 @@
*/
public int getChildCount()
{
- if ( null == m_children )
+ if ( null == children )
{
return 0;
}
- return m_children.size();
+ return children.size();
}
/**
@@ -524,7 +524,7 @@
*/
public void makeReadOnly()
{
- m_readOnly = true;
+ readOnly = true;
}
/**
@@ -532,10 +532,10 @@
*
* @throws java.lang.IllegalStateException if this configuration s read-only
*/
- protected final void checkWriteable()
+ protected void checkWriteable()
throws IllegalStateException
{
- if ( m_readOnly )
+ if ( readOnly )
{
throw new IllegalStateException
( "Configuration is read only and can not be modified" );