Package org.apache.uima.pear.tools
Class InstallationDescriptorHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.uima.pear.tools.InstallationDescriptorHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
The
InstallationDescriptorHandler class allows parsing XML installation descriptor
files, creating instances of the InstallationDescriptor class. The
InstallationDescriptorHandler class also allows to save existing
InstallationDescriptor objects as XML files.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Receives notification of character data inside an element.voidReceives notification of the end of the document.voidendElement(String uri, String localName, String qName) Receive notification of the end of an element.voidXML parser error handler.voidXML parser fatal error handler.static InputStreamReturns the content of the installation descriptor XML file for a given intallation descriptor object asInputStreamobject (for use in Eclipse plug-in).voidStarts parsing a given XML file.voidparse(InputStream xmlStream) Starts parsing XML content from a given input stream.voidparseInstallationDescriptor(JarFile pearFile) Parses XML installation descriptor automatically extracting it from a given PEAR (JAR) file.static voidprintInstallationDescriptor(InstallationDescriptor insdObject, PrintWriter oWriter) Prints a givenInstallationDescriptorobject in XML format to a givenPrintWriter.voidsaveInstallationDescriptor(File xmlFile) Saves createdInstallationDescriptorobject to a given XML file.static voidsaveInstallationDescriptor(InstallationDescriptor insdObject, File xmlFile) Saves a givenInstallationDescriptorobject in a given XML file.voidReceives notification of the beginning of the document.voidstartElement(String uri, String localName, String qName, Attributes attributes) Receives notification of the start of an element.voidXML parser warning handler.Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDeclMethods 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
-
Field Details
-
XML_HEADER
- See Also:
-
ROOT_TAG
- See Also:
-
OS_TAG
- See Also:
-
NAME_TAG
- See Also:
-
VERSION_TAG
- See Also:
-
TOOLKITS_TAG
- See Also:
-
JDK_VERSION_TAG
- See Also:
-
UIMA_FRAMEWORK_TAG
- See Also:
-
UIMA_VERSION_TAG
- See Also:
-
TAF_VERSION_TAG
- See Also:
-
SUBMITTED_COMPONENT_TAG
- See Also:
-
ID_TAG
- See Also:
-
DESC_TAG
- See Also:
-
DEPLOYMENT_TAG
- See Also:
-
STANDARD_TAG
- See Also:
-
SERVICE_TAG
- See Also:
-
NETWORK_TAG
- See Also:
-
SERVICE_COMMAND_TAG
- See Also:
-
SERVICE_WORKING_DIR_TAG
- See Also:
-
SERVICE_COMMAND_ARGS_TAG
- See Also:
-
ARGUMENT_TAG
- See Also:
-
VALUE_TAG
- See Also:
-
NETWORK_PARAMETERS_TAG
- See Also:
-
COMMENTS_TAG
- See Also:
-
COLLECTION_READER_TAG
- See Also:
-
COLLECTION_ITERATOR_DESC_TAG
- See Also:
-
CAS_INITIALIZER_DESC_TAG
- See Also:
-
CAS_CONSUMER_TAG
- See Also:
-
INSTALLATION_TAG
- See Also:
-
DELEGATE_COMPONENT_TAG
- See Also:
-
PROCESS_TAG
- See Also:
-
ACTION_TAG
- See Also:
-
PARAMETERS_TAG
- See Also:
-
FILE_TAG
- See Also:
-
FIND_STRING_TAG
- See Also:
-
REPLACE_WITH_TAG
- See Also:
-
VAR_NAME_TAG
- See Also:
-
VAR_VALUE_TAG
- See Also:
-
-
Constructor Details
-
InstallationDescriptorHandler
public InstallationDescriptorHandler()
-
-
Method Details
-
getInstallationDescriptorAsStream
public static InputStream getInstallationDescriptorAsStream(InstallationDescriptor insdObject) throws IOException Returns the content of the installation descriptor XML file for a given intallation descriptor object asInputStreamobject (for use in Eclipse plug-in).- Parameters:
insdObject- The given intallation descriptor object.- Returns:
- The
InputStreamobject that contains the content of the installation descriptor XML file. - Throws:
IOException- if any I/O exception occurred.
-
printInstallationDescriptor
public static void printInstallationDescriptor(InstallationDescriptor insdObject, PrintWriter oWriter) throws IOException Prints a givenInstallationDescriptorobject in XML format to a givenPrintWriter.- Parameters:
insdObject- The givenInstallationDescriptorobject.oWriter- The givenPrintWriterobject.- Throws:
IOException- if any I/O exception occurred.
-
saveInstallationDescriptor
public static void saveInstallationDescriptor(InstallationDescriptor insdObject, File xmlFile) throws IOException Saves a givenInstallationDescriptorobject in a given XML file.- Parameters:
insdObject- The givenInstallationDescriptorobject.xmlFile- The given XML file.- Throws:
IOException- if any I/O exception occurred.
-
characters
Receives notification of character data inside an element.- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Parameters:
ch- The characters.start- The start position in the character array.length- The number of characters to use from the character array.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.
-
endDocument
Receives notification of the end of the document.- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.
-
endElement
Receive notification of the end of an element.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Parameters:
uri- The element URI.localName- The element type name.qName- The qualified name of the element.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.
-
error
XML parser error handler.- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException
-
fatalError
XML parser fatal error handler.- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Throws:
SAXException
-
getInstallationDescriptor
- Returns:
InstallationDescriptorobject after the installation descriptor file has been loaded, ornull, if the file was not loaded.
-
parse
Starts parsing a given XML file. After parsing is completed, the application may access parsing results using convenient methods.- Parameters:
xmlFile- The given XML file.- Throws:
IOException- Any I/O exception.SAXException- Any SAX exception, possibly wrapping another exception.
-
parse
Starts parsing XML content from a given input stream.- Parameters:
xmlStream- The given XML input stream.- Throws:
IOException- if any I/O exception occurred.SAXException- Any SAX exception, possibly wrapping another exception.
-
parseInstallationDescriptor
Parses XML installation descriptor automatically extracting it from a given PEAR (JAR) file.- Parameters:
pearFile- The given PEAR (JAR) file.- Throws:
IOException- if any I/O exception occurred.SAXException- Any SAX exception, possibly wrapping another exception.
-
saveInstallationDescriptor
Saves createdInstallationDescriptorobject to a given XML file.- Parameters:
xmlFile- The given XML file.- Throws:
IOException- if any I/O exception occurred.
-
startDocument
Receives notification of the beginning of the document.- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException Receives notification of the start of an element.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Parameters:
uri- The element URI.localName- The element type name.qName- The qualified name of the element.attributes- The specified or defaulted attributes.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.
-
warning
XML parser warning handler.- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler- Throws:
SAXException
-