org.jage.platform.config.loader.xml
Class XmlFileLoader

java.lang.Object
  extended by org.jage.platform.config.loader.xml.XmlFileLoader

public class XmlFileLoader
extends Object

Loads and validates data from XML file. It reads also data from files specified in any include tags. Validation is based on the following schema: http://age.iisg.agh.edu.pl/xsd/age-2.5.xsd

Author:
AGH AgE Team

Field Summary
static String AGE_SCHEMA_SOURCE
          A file name of the schema definition for the AgE configuration file.
static String JAXP_SCHEMA_LANGUAGE
          A schema language definition for Java API for XML Processing.
static String JAXP_SCHEMA_SOURCE
          A schema source for Java API for XML Processing.
static String W3C_XML_SCHEMA
          A namespace for XML Schema.
 
Constructor Summary
XmlFileLoader()
          Default constructor.
 
Method Summary
 Document loadAndValidateDocument(String path)
          Loads and validates XML document from specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAXP_SCHEMA_LANGUAGE

public static final String JAXP_SCHEMA_LANGUAGE
A schema language definition for Java API for XML Processing.

See Also:
Constant Field Values

W3C_XML_SCHEMA

public static final String W3C_XML_SCHEMA
A namespace for XML Schema.

See Also:
Constant Field Values

JAXP_SCHEMA_SOURCE

public static final String JAXP_SCHEMA_SOURCE
A schema source for Java API for XML Processing.

See Also:
Constant Field Values

AGE_SCHEMA_SOURCE

public static final String AGE_SCHEMA_SOURCE
A file name of the schema definition for the AgE configuration file.

See Also:
Constant Field Values
Constructor Detail

XmlFileLoader

public XmlFileLoader()
Default constructor. Initialises builder factory.

Method Detail

loadAndValidateDocument

public Document loadAndValidateDocument(String path)
                                 throws ConfigurationException
Loads and validates XML document from specified file. Reads also all files which are included.

Parameters:
path - the root file to read XML data
Returns:
XML document
Throws:
ConfigurationException - if any exception occur during loading or validating file. Detailed information about error are include into this exception.


Copyright © 2006-2011 AGH University of Science and Technology. All Rights Reserved.