|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.impl.config.domain.key.envapp.AbstractDefinitionConfigParser<T>
T
- the type of context returned by the parser.
public abstract class AbstractDefinitionConfigParser<T extends PropertiesDefinitionContext>
Base implementation for parsing a definition.xml
file for properties.
Field Summary | |
---|---|
protected org.jdom.Namespace |
namespace The namespace of definition files parsed by this parser. |
Constructor Summary | |
---|---|
protected |
AbstractDefinitionConfigParser(org.jdom.Namespace namespace) Default constructor. |
Method Summary | |
---|---|
protected static String |
norm(String text) Normalizes the text. |
T |
parse(Class<?> type) Convenience method using a class' class loader to locate the configuration file to parse the configuration file at PropertiesContext.DEFINITION_FILE . |
T |
parse(de.smartics.util.lang.classpath.ClassPathContext context) Parses the configuration file at PropertiesContext.DEFINITION_FILE . |
protected ApplicationId |
readApplication(org.jdom.Element rootNode) Parses application information. |
protected EnvironmentId |
readEnvironment(org.jdom.Element rootNode) Parses environment information. |
protected PropertyResourceMatchers |
readFiles(String systemId, org.jdom.Element rootNode) Parsed the map of files from the given element. |
protected abstract ConfigurationKey<?> |
readKey(org.jdom.Element element) Parses the configuration key. |
protected Set<String> |
readSet(org.jdom.Element rootNode, String setGi, String elementGi) Parses a set. |
protected Set<String> |
readSet(org.jdom.Element rootNode, String setGi, String elementGi, Set<String> defaultSet) Parses a set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.smartics.properties.spi.config.definition.DefinitionConfigParser |
---|
parse |
Field Detail |
---|
protected final org.jdom.Namespace namespace
Constructor Detail |
---|
protected AbstractDefinitionConfigParser(org.jdom.Namespace namespace)
namespace
- the namespace of definition files parsed by this parser.
Method Detail |
---|
public final T parse(Class<?> type) throws ConfigException
PropertiesContext.DEFINITION_FILE
.
parse
in interface
DefinitionConfigParser<T extends PropertiesDefinitionContext>
type
- the type whose class loader to use to locate the configuration file.
null
.
ConfigException
- on any problem loading the file.
public final T parse(de.smartics.util.lang.classpath.ClassPathContext context) throws ConfigException
PropertiesContext.DEFINITION_FILE
.
parse
in interface
DefinitionConfigParser<T extends PropertiesDefinitionContext>
context
- the class loader with its context to use to locate the configuration file.
null
.
ConfigException
- on any problem loading the file.
protected final Set<String> readSet(org.jdom.Element rootNode, String setGi, String elementGi)
rootNode
- the root node that contains the set.
setGi
- the name of the element that is the set.
elementGi
- the name of the elements within the set.
protected final Set<String> readSet(org.jdom.Element rootNode, String setGi, String elementGi, Set<String> defaultSet)
rootNode
- the root node that contains the set.
setGi
- the name of the element that is the set.
elementGi
- the name of the elements within the set.
defaultSet
- the set to return if no set is found within the root node.
protected final PropertyResourceMatchers readFiles(String systemId, org.jdom.Element rootNode) throws ConfigException
systemId
- the identifier of the configuration file that is parsed.
rootNode
- the node within which the files are.
ConfigException
- if the configuration is not valid.
protected abstract ConfigurationKey<?> readKey(org.jdom.Element element)
element
- the element within which the elements of the key are located.
protected final EnvironmentId readEnvironment(org.jdom.Element rootNode)
rootNode
- the element to parse from.
protected final ApplicationId readApplication(org.jdom.Element rootNode)
rootNode
- the element to parse from.
protected static final String norm(String text)
text
- the text to normalize.
null
if
text
is blank, the text otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |