public class ConfigDocumentLoader extends DocumentLoader implements PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_PROPERTY
Property holding the path to the config XML text.
|
static String |
CONFIG_ROOT
Root element of config XML text.
|
static String |
DEFAULT_CONFIG
Default source of config XML text.
|
static String[] |
DOCTYPE_STRINGS
The document type strings.
|
static String |
VALIDATION_DISABLED_PROPERTY
Validation control properties.
|
static String |
VALIDATION_ENABLED_PROPERTY |
ID_PATTERN, ID_PREFIX
Modifier and Type | Method and Description |
---|---|
protected DocumentLoader.RootHandler |
getRootHandler()
Gets a root handler.
|
protected String |
getRootName()
Gets the root element name for this document.
|
protected URL |
getURL()
Gets the URL for this document.
|
static Config |
loadConfig(String serviceName,
Optional<String> from,
Optional<ServiceClassLoader> classLoader)
Loads the config.
|
protected boolean |
loadFrom(String from,
Optional<Reader> reader)
Loads this document from the specified location with a supplied reader.
|
void |
propertyChange(PropertyChangeEvent event)
Called when a monitored property changes.
|
protected boolean |
read(String xml)
Reads the document from an XML string.
|
protected void |
setURL(URL url)
Sets the URL for this document.
|
addPrefixNames, getEntity, getPrefixName, getThisLogger, handle, newXMLElement, setEntities, setSubstitutionDeferred, setSubstitutionEnabled, setValidating
public static final String CONFIG_PROPERTY
public static final String CONFIG_ROOT
public static final String DEFAULT_CONFIG
public static final String[] DOCTYPE_STRINGS
public static final String VALIDATION_DISABLED_PROPERTY
public static final String VALIDATION_ENABLED_PROPERTY
@Nullable @CheckReturnValue public static Config loadConfig(@Nonnull String serviceName, @Nonnull Optional<String> from, @Nonnull Optional<ServiceClassLoader> classLoader)
serviceName
- The name of the service the config is loaded for.from
- The optional location to load from.classLoader
- An optional class loader.public final void propertyChange(PropertyChangeEvent event)
propertyChange
in interface PropertyChangeListener
event
- The event describing the change.protected DocumentLoader.RootHandler getRootHandler()
getRootHandler
in class DocumentLoader
protected final String getRootName()
getRootName
in class DocumentLoader
protected URL getURL()
getURL
in class DocumentLoader
protected boolean loadFrom(String from, Optional<Reader> reader)
loadFrom
in class DocumentLoader
from
- The location to load from.reader
- The optional reader.protected boolean read(String xml)
read
in class DocumentLoader
xml
- The XML string.protected final void setURL(URL url)
setURL
in class DocumentLoader
url
- The URL.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.