pl.psnc.dl.ege.validator
Class XmlValidatorsProvider

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by pl.psnc.dl.ege.validator.XmlValidatorsProvider
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class XmlValidatorsProvider
extends org.xml.sax.helpers.DefaultHandler

Singleton - prepares available XML validators.
Basic configuration of every XML validator is parsed from 'validators.xml' file - provided with this implementation.

Author:
mariuszs

Field Summary
static java.lang.String A_FORMAT
          XML configuration : format attribute
static java.lang.String A_MIME
          XML configuration : mimeType attribute
static java.lang.String A_ROOT
          XML configuration : root attribute
static java.lang.String A_SYSTEM_ID
          XML configuration : systemId attribute
static java.lang.String A_URL
          XML configuration : url attribute
static java.lang.String EGE_EAD
          Informs provider that it has to use default EAD DTD reference (contained in .jar file most likely)
static java.lang.String T_DTD
          XML configuration : dtd attribute
static java.lang.String T_SCHEME
          XML configuration : scheme attribute
static java.lang.String T_VALIDATOR
          XML configuration : validator element
static java.lang.String T_VALIDATORS
          XML configuration : validators element
 
Method Summary
static XmlValidatorsProvider getInstance()
          Provider as singleton - method returns instance.
 java.util.List<DataType> getSupportedDataTypes()
          Returns supported data types.
 XmlValidator getValidator(DataType dataType)
          Returns XML validator by selected data type (null if data type is not supported).
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

T_VALIDATORS

public static final java.lang.String T_VALIDATORS
XML configuration : validators element

See Also:
Constant Field Values

T_VALIDATOR

public static final java.lang.String T_VALIDATOR
XML configuration : validator element

See Also:
Constant Field Values

A_FORMAT

public static final java.lang.String A_FORMAT
XML configuration : format attribute

See Also:
Constant Field Values

A_MIME

public static final java.lang.String A_MIME
XML configuration : mimeType attribute

See Also:
Constant Field Values

T_SCHEME

public static final java.lang.String T_SCHEME
XML configuration : scheme attribute

See Also:
Constant Field Values

T_DTD

public static final java.lang.String T_DTD
XML configuration : dtd attribute

See Also:
Constant Field Values

A_URL

public static final java.lang.String A_URL
XML configuration : url attribute

See Also:
Constant Field Values

A_ROOT

public static final java.lang.String A_ROOT
XML configuration : root attribute

See Also:
Constant Field Values

A_SYSTEM_ID

public static final java.lang.String A_SYSTEM_ID
XML configuration : systemId attribute

See Also:
Constant Field Values

EGE_EAD

public static final java.lang.String EGE_EAD
Informs provider that it has to use default EAD DTD reference (contained in .jar file most likely)

See Also:
Constant Field Values
Method Detail

getInstance

public static XmlValidatorsProvider getInstance()
Provider as singleton - method returns instance.

Returns:

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

getValidator

public XmlValidator getValidator(DataType dataType)
Returns XML validator by selected data type (null if data type is not supported).

Parameters:
dataType -
Returns:

getSupportedDataTypes

public java.util.List<DataType> getSupportedDataTypes()
Returns supported data types.

Returns:


Copyright © 2010. All Rights Reserved.