Package org.apache.velocity.tools.config
Class Configuration
- java.lang.Object
-
- org.apache.velocity.tools.config.Configuration
-
- All Implemented Interfaces:
java.lang.Comparable<Configuration>
- Direct Known Subclasses:
CompoundConfiguration
,ToolConfiguration
public class Configuration extends java.lang.Object implements java.lang.Comparable<Configuration>
This base configuration class manages a set of
Property
s for whatever thing the instance of this class represents. When combined with anotherConfiguration
instance viaaddConfiguration(org.apache.velocity.tools.config.Configuration)
, theProperty
s of both instances are combined.NOTE: Though this class appears
Comparable
, thecompareTo(org.apache.velocity.tools.config.Configuration)
method is unsupported. Proper comparison is left up to subclasses.- Version:
- $Id: Configuration.java 511959 2007-02-26 19:24:39Z nbubna $
- Author:
- Nathan Bubna
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.SortedSet<Property>
properties
-
Constructor Summary
Constructors Constructor Description Configuration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConfiguration(Configuration config)
void
addProperty(Property property)
protected void
appendProperties(java.lang.StringBuilder out)
int
compareTo(Configuration config)
boolean
equals(java.lang.Object obj)
java.util.SortedSet<Property>
getProperties()
Property
getProperty(java.lang.String name)
java.util.Map<java.lang.String,java.lang.Object>
getPropertyMap()
int
hashCode()
boolean
hasProperties()
boolean
removeProperty(java.lang.String name)
boolean
removeProperty(Property property)
void
setProperties(java.util.Collection<Property> props)
void
setProperty(java.lang.String name, java.lang.Object value)
void
setPropertyMap(java.util.Map<java.lang.String,java.lang.Object> props)
void
validate()
-
-
-
Field Detail
-
properties
private final java.util.SortedSet<Property> properties
-
-
Method Detail
-
addProperty
public void addProperty(Property property)
-
removeProperty
public boolean removeProperty(Property property)
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object value)
-
removeProperty
public boolean removeProperty(java.lang.String name)
-
hasProperties
public boolean hasProperties()
-
getProperty
public Property getProperty(java.lang.String name)
-
getProperties
public java.util.SortedSet<Property> getProperties()
-
getPropertyMap
public java.util.Map<java.lang.String,java.lang.Object> getPropertyMap()
-
setPropertyMap
public void setPropertyMap(java.util.Map<java.lang.String,java.lang.Object> props)
-
setProperties
public void setProperties(java.util.Collection<Property> props)
-
addConfiguration
public void addConfiguration(Configuration config)
-
validate
public void validate()
-
compareTo
public int compareTo(Configuration config)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Configuration>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
appendProperties
protected void appendProperties(java.lang.StringBuilder out)
-
-