OSFI-Java
3.10.0
OpenSF Integration Library
|
Classes | |
class | ParamParsingException |
enum | WarningType |
Public Member Functions | |
ParamReader (final String xmlFile, final String xsdFile) throws FileNotFoundException, XmlParseException | |
ParamReader (String xmlFile) throws FileNotFoundException, XmlParseException | |
ParamReader (Element el, String pathPrefix) throws XmlParseException | |
boolean | validateAgainst (final String xsdFile) |
boolean | validateAgainstInternalSchema () |
Parameter | getParameter (String name) |
List< Parameter > | getParameters (String groupName) |
Map< String, Parameter > | getAllParameters () |
boolean | existParameter (String name) |
void | setParameter (String paramName, Parameter value) |
void | write () |
Static Public Member Functions | |
static LoadResult< ParamReader > | load (final LoadResult< Document > xml, final boolean stopOnSingleParamError, final Map< String, Parameter > map, final Set< WarningType > suppWarns) |
static LoadResult< ParamReader > | load (final LoadResult< Document > xml, final boolean stopOnSingleParamError, final Map< String, Parameter > map) |
static LoadResult< ParamReader > | load (final LoadResult< Document > xml, final boolean stopOnSingleParamError) |
static boolean | isStandardAttribute (String key) |
ParamReader.
Constructs the list of parameters associated with a model stored in a XML configuration file.
Uses the DOM tree specification.
esa.opensf.osfi.ParamReader.ParamReader | ( | final String | xmlFile, |
final String | xsdFile | ||
) | throws FileNotFoundException, XmlParseException |
Creates an instance of the ParamReader class, parses a given configuration XML file and stores every valid parameter.
xmlFile | Configuration XML file |
xsdFile | Configuration XSD schema. Validating against an XSD schema is optional |
XmlParseException | if error while parsing |
FileNotFoundException | if the XML file does not exist or cannot be read |
References esa.opensf.osfi.XMLParser.read().
esa.opensf.osfi.ParamReader.ParamReader | ( | String | xmlFile | ) | throws FileNotFoundException, XmlParseException |
Parses a given configuration XML file and stores the parameters read from it.
xmlFile | Configuration XML file |
XmlParseException | if any error occurs while parsing |
FileNotFoundException | if the XML file does not exist or cannot be read |
References esa.opensf.osfi.xmlutils.XmlFiles.load().
esa.opensf.osfi.ParamReader.ParamReader | ( | Element | el, |
String | pathPrefix | ||
) | throws XmlParseException |
Parses a given configuration XML subtree and stores the parameters read from it. This allows the user to read parameter objects from an OSFI-compliant fragment of a non-OSFI file.
el | Element that will be considered the root of the given tree. Note that this element is not parsed itself, only its children are. Thus, if a single parameter is to be parsed, it needs to be wrapped by an element. |
pathPrefix | Path up to and including el. If not null, paths of child parameters/groups will be prefixed with this string plus a period. |
XmlParseException | if error while parsing |
boolean esa.opensf.osfi.ParamReader.existParameter | ( | String | name | ) |
Checks the existence of a parameter within a configuration file.
name | Parameter name (full path and name) |
Map<String, Parameter> esa.opensf.osfi.ParamReader.getAllParameters | ( | ) |
Parameter esa.opensf.osfi.ParamReader.getParameter | ( | String | name | ) |
List<Parameter> esa.opensf.osfi.ParamReader.getParameters | ( | String | groupName | ) |
groupName | Full name of the group |
|
static |
Determines whether a given parameter attribute is E2E-ICD standard.
key | attribute name |
|
static |
Parse the contents of an XML document into OSFI parameters. Equivalent to calling the other overload with a new empty map as the third argument.
xml | Returned by calling one of the loader functions in XmlFiles |
stopOnSingleParamError | If true, an error loading a single parameter will stop the process. Otherwise, only a fatal error (e.g. a structural) |
References esa.opensf.osfi.ParamReader.load().
|
static |
Parse the contents of an XML document into OSFI parameters. Equivalent to calling load(LoadResult, boolean, Map, Set) with a a default set of suppressed warnings.
xml | Returned by calling one of the loader functions in XmlFiles |
stopOnSingleParamError | If true, an error loading a single parameter will stop the process. Otherwise, only a fatal error (e.g. a structural). |
map | Container that will be used to store the parameters read. |
References esa.opensf.osfi.ParamReader.load().
|
static |
Parse the contents of an XML document into OSFI parameters.
xml | Returned by calling one of the loader functions in XmlFiles |
stopOnSingleParamError | If true, an error loading a single parameter will stop the process. Otherwise, only a fatal error (e.g. a structural). |
map | Container that will be used to store the parameters read. |
suppWarns | The types of warnings that will be suppressed. |
References esa.opensf.osfi.LoadResult< R >.loadEvents, esa.opensf.osfi.LoadResult< R >.result, and esa.opensf.osfi.LoadResult< R >.source.
void esa.opensf.osfi.ParamReader.setParameter | ( | String | paramName, |
Parameter | value | ||
) |
Changes the stored value of a certain parameter. Shows an error if cannot find parameter.
paramName | - full name of the parameter |
value | - new value |
IllegalArgumentException | if parameter did not already exist |
References esa.opensf.osfi.Logger.error(), esa.opensf.osfi.ParamReader.existParameter(), and esa.opensf.osfi.Logger.warning().
boolean esa.opensf.osfi.ParamReader.validateAgainst | ( | final String | xsdFile | ) |
Validate the XML file read against the given XSD schema.
xsdFile | Path to a schema file which must exist |
IllegalArgumentException | if the schema cannot be loaded |
References esa.opensf.osfi.xmlutils.DomUtils.validateAgainst().
boolean esa.opensf.osfi.ParamReader.validateAgainstInternalSchema | ( | ) |
Validate the XML file read against the XSD schema referenced in the file itself.
References esa.opensf.osfi.xmlutils.DomUtils.validateAgainstInternalSchema().
void esa.opensf.osfi.ParamReader.write | ( | ) |
Prints a textual representation of the list of Parameters on screen.
References esa.opensf.osfi.Logger.info().