org.activemath.abstractcontent
Class SubconfImpl.AbstractSubconfiguration

java.lang.Object
  extended by org.activemath.abstractcontent.SubconfImpl.AbstractSubconfiguration
All Implemented Interfaces:
Subconfiguration
Direct Known Subclasses:
SubconfImpl.ChildSubconfiguration, SubconfImpl.PropertiesConfig, SubconfImpl.UnionSubconfiguration
Enclosing class:
SubconfImpl

public abstract static class SubconfImpl.AbstractSubconfiguration
extends Object
implements Subconfiguration

This provides a raw base providing no services and no string-properties


Constructor Summary
SubconfImpl.AbstractSubconfiguration()
           
 
Method Summary
 boolean getBoolean(String name)
          Attempts to convert the string-value returned by getProperty(java.lang.String) to a boolean using Boolean.valueOf(boolean).
abstract  Collection getChildrenNames(String prefix)
          Returns the next step completion given the named prefix.
 int getInt(String name)
          Attempts to convert the string-value returned by getProperty(java.lang.String) to an integer using Integer.parseInt(java.lang.String, int).
abstract  URL getPath(String name)
          Computes the path of the given properties according to ActiveMath's mechanism (using a possible extra <name>.refType property.
abstract  String getProperty(String name)
          Returns the values for the given name or null if there's none.
abstract  Iterator getPropertyNames()
          Returns an enumeration of all the property names.
 Subconfiguration getSubconfiguration(String prefix)
          Creates a sub-configuration object with the properties with given prefix.
abstract  void setDefaultProperties(Map props)
          Sets the default properties for this component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.activemath.abstractcontent.Subconfiguration
getService, pathFromString, refreshServices
 

Constructor Detail

SubconfImpl.AbstractSubconfiguration

public SubconfImpl.AbstractSubconfiguration()
Method Detail

getProperty

public abstract String getProperty(String name)
Description copied from interface: Subconfiguration
Returns the values for the given name or null if there's none.

Specified by:
getProperty in interface Subconfiguration

setDefaultProperties

public abstract void setDefaultProperties(Map props)
Description copied from interface: Subconfiguration
Sets the default properties for this component. This allows a configured object to set its default values which are used by the configuration implementation. The keys and values of the map passed as argument are supposed to be String.

Specified by:
setDefaultProperties in interface Subconfiguration

getBoolean

public boolean getBoolean(String name)
Attempts to convert the string-value returned by getProperty(java.lang.String) to a boolean using Boolean.valueOf(boolean). The properties should hence be "true" of "false".

Specified by:
getBoolean in interface Subconfiguration
Throws:
IllegalArgumentException - if the conversion fails (for example if the value returned by getProperty(java.lang.String) is null)

getInt

public int getInt(String name)
Attempts to convert the string-value returned by getProperty(java.lang.String) to an integer using Integer.parseInt(java.lang.String, int).

Specified by:
getInt in interface Subconfiguration
Throws:
IllegalArgumentException - if the conversion fails (for example if the value returned by getProperty(java.lang.String) is null)

getPath

public abstract URL getPath(String name)
Description copied from interface: Subconfiguration
Computes the path of the given properties according to ActiveMath's mechanism (using a possible extra <name>.refType property.

Specified by:
getPath in interface Subconfiguration
See Also:
Manager.getPath(java.lang.String)

getPropertyNames

public abstract Iterator getPropertyNames()
Description copied from interface: Subconfiguration
Returns an enumeration of all the property names.

Specified by:
getPropertyNames in interface Subconfiguration

getChildrenNames

public abstract Collection getChildrenNames(String prefix)
Description copied from interface: Subconfiguration
Returns the next step completion given the named prefix.

As an example, given

    i.a.blop.c = val1
i.b.blip = val2

This method, called with "i", would return the enumeration made of the string "a" and the string "b".

Specified by:
getChildrenNames in interface Subconfiguration
Parameters:
prefix - the prefix string, without the trailing "." or null if the root property names is wished.

getSubconfiguration

public Subconfiguration getSubconfiguration(String prefix)
Description copied from interface: Subconfiguration
Creates a sub-configuration object with the properties with given prefix.

Specified by:
getSubconfiguration in interface Subconfiguration
Parameters:
prefix - the prefix string, without the trailing "."
Returns:
a SubconfImpl.ChildSubconfiguration that is backed by the current subconfiguration.