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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) Receives notification of character data inside an element.void
Receives notification of the end of the document.void
endElement
(String uri, String localName, String qName) Receive notification of the end of an element.void
XML parser error handler.void
XML parser fatal error handler.static InputStream
Returns the content of the installation descriptor XML file for a given intallation descriptor object asInputStream
object (for use in Eclipse plug-in).void
Starts parsing a given XML file.void
parse
(InputStream xmlStream) Starts parsing XML content from a given input stream.void
parseInstallationDescriptor
(JarFile pearFile) Parses XML installation descriptor automatically extracting it from a given PEAR (JAR) file.static void
printInstallationDescriptor
(InstallationDescriptor insdObject, PrintWriter oWriter) Prints a givenInstallationDescriptor
object in XML format to a givenPrintWriter
.void
saveInstallationDescriptor
(File xmlFile) Saves createdInstallationDescriptor
object to a given XML file.static void
saveInstallationDescriptor
(InstallationDescriptor insdObject, File xmlFile) Saves a givenInstallationDescriptor
object in a given XML file.void
Receives notification of the beginning of the document.void
startElement
(String uri, String localName, String qName, Attributes attributes) Receives notification of the start of an element.void
XML parser warning handler.Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 asInputStream
object (for use in Eclipse plug-in).- Parameters:
insdObject
- The given intallation descriptor object.- Returns:
- The
InputStream
object 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 givenInstallationDescriptor
object in XML format to a givenPrintWriter
.- Parameters:
insdObject
- The givenInstallationDescriptor
object.oWriter
- The givenPrintWriter
object.- Throws:
IOException
- if any I/O exception occurred.
-
saveInstallationDescriptor
public static void saveInstallationDescriptor(InstallationDescriptor insdObject, File xmlFile) throws IOException Saves a givenInstallationDescriptor
object in a given XML file.- Parameters:
insdObject
- The givenInstallationDescriptor
object.xmlFile
- The given XML file.- Throws:
IOException
- if any I/O exception occurred.
-
characters
Receives notification of character data inside an element.- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in 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:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.
-
endElement
Receive notification of the end of an element.- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in 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:
error
in interfaceErrorHandler
- Overrides:
error
in classDefaultHandler
- Throws:
SAXException
-
fatalError
XML parser fatal error handler.- Specified by:
fatalError
in interfaceErrorHandler
- Overrides:
fatalError
in classDefaultHandler
- Throws:
SAXException
-
getInstallationDescriptor
- Returns:
InstallationDescriptor
object 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 createdInstallationDescriptor
object 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:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in 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:
startElement
in interfaceContentHandler
- Overrides:
startElement
in 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:
warning
in interfaceErrorHandler
- Overrides:
warning
in classDefaultHandler
- Throws:
SAXException
-