/** * Set the value of this <code>Configuration</code> object to the specified string. * * @param value a <code>String</code> value */ public void setValue( final String value ) { checkWriteable(); m_value = value; }
/** * Append data to the value of this configuration element. * * @param value a <code>String</code> value * @deprecated Use setValue() instead */ public void appendValueData( final String value ) { checkWriteable(); if( null == m_value ) { m_value = value; } else { m_value += value; } }
/** * Remove a child <code>Configuration</code> to this configuration element. * @param configuration a <code>Configuration</code> value */ public void removeChild( final Configuration configuration ) { checkWriteable(); if( null == m_children ) { return; } m_children.remove( configuration ); }
/** * Add a child <code>Configuration</code> to this configuration element. * @param configuration a <code>Configuration</code> value */ public void addChild( final Configuration configuration ) { checkWriteable(); if( null == m_children ) { m_children = new ArrayList(); } m_children.add( configuration ); }
/** * Add an attribute to this configuration element, returning its old * value or <b>null</b>. * * @param name a <code>String</code> value * @param value a <code>String</code> value * @return a <code>String</code> value * @deprecated Use setAttribute() instead */ public String addAttribute( final String name, String value ) { checkWriteable(); if( null == m_attributes ) { m_attributes = new HashMap(); } return (String)m_attributes.put( name, value ); }
/** * Set the value of the specified attribute to the specified string. * * @param name name of the attribute to set * @param value a <code>String</code> value */ public void setAttribute( final String name, final String value ) { checkWriteable(); if( null != value ) { if( null == m_attributes ) { m_attributes = new HashMap(); } m_attributes.put( name, value ); } else { if( null != m_attributes ) { m_attributes.remove( name ); } } }
/** * Add all child <code>Configuration</code> objects from specified * configuration element to current configuration element. * * @param other the other {@link Configuration} value */ public void addAllChildren( final Configuration other ) { checkWriteable(); final Configuration[] children = other.getChildren(); for( int i = 0; i < children.length; i++ ) { addChild( children[ i ] ); } }
/** * Add all attributes from specified configuration * element to current configuration element. * * @param other the {@link Configuration} element */ public void addAllAttributes( final Configuration other ) { checkWriteable(); final String[] attributes = other.getAttributeNames(); for( int i = 0; i < attributes.length; i++ ) { final String name = attributes[ i ]; final String value = other.getAttribute( name, null ); setAttribute( name, value ); } }
/** * Add all the attributes, children and value * from specified configuration element to current * configuration element. * * @param other the {@link Configuration} element */ public void addAll( final Configuration other ) { checkWriteable(); setValue( other.getValue( null ) ); addAllAttributes( other ); addAllChildren( other ); }
/** * Add all the attributes, children and value * from specified configuration element to current * configuration element. * * @param other the {@link Configuration} element * @param deepCopy true will cause clones of the children to be added, * false will add the original instances and is thus * faster. * * throws ConfigurationException If there are any problems cloning the * children. */ public void addAll( final Configuration other, final boolean deepCopy ) throws ConfigurationException { checkWriteable(); setValue( other.getValue( null ) ); addAllAttributes( other ); addAllChildren( other, deepCopy ); }
throws ConfigurationException checkWriteable();