Package org.h2.security.auth
Class H2AuthConfigXml
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.h2.security.auth.H2AuthConfigXml
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
Parser of external authentication XML configuration file
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendElement(String uri, String localName, String qName) Returns parsed authenticator configuration.static H2AuthConfigparseFrom(InputStream inputStream) Parse the xml.static H2AuthConfigParse the xml.resolveEntity(String publicId, String systemId) voidstartElement(String uri, String localName, String qName, Attributes attributes) Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
H2AuthConfigXml
public H2AuthConfigXml()
-
-
Method Details
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
resolveEntity
- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classDefaultHandler- Throws:
IOExceptionSAXException
-
getResult
Returns parsed authenticator configuration.- Returns:
- Authenticator configuration.
-
parseFrom
public static H2AuthConfig parseFrom(URL url) throws SAXException, IOException, ParserConfigurationException Parse the xml.- Parameters:
url- the source of the xml configuration.- Returns:
- Authenticator configuration.
- Throws:
ParserConfigurationException- if a parser cannot be created.SAXException- for SAX errors.IOException- If an I/O error occurs
-
parseFrom
public static H2AuthConfig parseFrom(InputStream inputStream) throws SAXException, IOException, ParserConfigurationException Parse the xml.- Parameters:
inputStream- the source of the xml configuration.- Returns:
- Authenticator configuration.
- Throws:
ParserConfigurationException- if a parser cannot be created.SAXException- for SAX errors.IOException- If an I/O error occurs
-