/** * Returns the namespace of this configuration element * @return a <code>String</code> value * @throws ConfigurationException if an error occurs * @since 4.1 */ public String getNamespace() throws ConfigurationException { if( null != m_namespace ) { return m_namespace; } else { throw new ConfigurationException ( "No namespace (not even default \"\") is associated with the " + "configuration element \"" + getName() + "\" at " + getLocation() ); } }
return new DefaultConfiguration( name, "<generated>" + getLocation(), m_namespace, m_prefix );
m_children.add( new DefaultImmutableConfiguration( children[i] ) );
/** * Returns the value of the configuration element as a <code>String</code>. * * @return a <code>String</code> value * @throws ConfigurationException If the value is not present. */ public String getValue() throws ConfigurationException { if( null != m_value ) { return m_value; } else { throw new ConfigurationException( "No value is associated with the " + "configuration element \"" + getName() + "\" at " + getLocation() ); } }
/** * Returns the prefix of the namespace * @return a <code>String</code> value * @throws ConfigurationException if prefix is not present (<code>null</code>). * @since 4.1 */ protected String getPrefix() throws ConfigurationException { if( null != m_prefix ) { return m_prefix; } else { throw new ConfigurationException ( "No prefix (not even default \"\") is associated with the " + "configuration element \"" + getName() + "\" at " + getLocation() ); } }
/** * Returns the value of the attribute specified by its name as a * <code>String</code>. * * @param name a <code>String</code> value * @return a <code>String</code> value * @throws ConfigurationException If the attribute is not present. */ public String getAttribute( final String name ) throws ConfigurationException { final String value = ( null != m_attributes ) ? (String)m_attributes.get( name ) : null; if( null != value ) { return value; } else { throw new ConfigurationException( "No attribute named \"" + name + "\" is " + "associated with the configuration element \"" + getName() + "\" at " + getLocation() ); } }