public class InstallationDescriptorHandler extends DefaultHandler
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.Constructor and Description |
---|
InstallationDescriptorHandler() |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
Receives notification of character data inside an element.
|
void |
endDocument()
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 |
error(SAXParseException ex)
XML parser error handler.
|
void |
fatalError(SAXParseException ex)
XML parser fatal error handler.
|
InstallationDescriptor |
getInstallationDescriptor() |
static InputStream |
getInstallationDescriptorAsStream(InstallationDescriptor insdObject)
Returns the content of the installation descriptor XML file for a given intallation descriptor
object as
InputStream object (for use in Eclipse plug-in). |
void |
parse(File xmlFile)
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 given
InstallationDescriptor object in XML format to a given
PrintWriter . |
void |
saveInstallationDescriptor(File xmlFile)
Saves created
InstallationDescriptor object to a given XML file. |
static void |
saveInstallationDescriptor(InstallationDescriptor insdObject,
File xmlFile)
Saves a given
InstallationDescriptor object in a given XML file. |
void |
startDocument()
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 |
warning(SAXParseException ex)
XML parser warning handler.
|
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
protected static final String XML_HEADER
public static final String ROOT_TAG
public static final String OS_TAG
public static final String NAME_TAG
public static final String VERSION_TAG
public static final String TOOLKITS_TAG
public static final String JDK_VERSION_TAG
public static final String UIMA_FRAMEWORK_TAG
public static final String UIMA_VERSION_TAG
public static final String TAF_VERSION_TAG
public static final String SUBMITTED_COMPONENT_TAG
public static final String ID_TAG
public static final String DESC_TAG
public static final String DEPLOYMENT_TAG
public static final String STANDARD_TAG
public static final String SERVICE_TAG
public static final String NETWORK_TAG
public static final String SERVICE_COMMAND_TAG
public static final String SERVICE_WORKING_DIR_TAG
public static final String SERVICE_COMMAND_ARGS_TAG
public static final String ARGUMENT_TAG
public static final String VALUE_TAG
public static final String NETWORK_PARAMETERS_TAG
public static final String COMMENTS_TAG
public static final String COLLECTION_READER_TAG
public static final String COLLECTION_ITERATOR_DESC_TAG
public static final String CAS_INITIALIZER_DESC_TAG
public static final String CAS_CONSUMER_TAG
public static final String INSTALLATION_TAG
public static final String DELEGATE_COMPONENT_TAG
public static final String PROCESS_TAG
public static final String ACTION_TAG
public static final String PARAMETERS_TAG
public static final String FILE_TAG
public static final String FIND_STRING_TAG
public static final String REPLACE_WITH_TAG
public static final String VAR_NAME_TAG
public static final String VAR_VALUE_TAG
public static InputStream getInstallationDescriptorAsStream(InstallationDescriptor insdObject) throws IOException
InputStream
object (for use in Eclipse plug-in).insdObject
- The given intallation descriptor object.InputStream
object that contains the content of the installation
descriptor XML file.IOException
- if any I/O exception occurred.public static void printInstallationDescriptor(InstallationDescriptor insdObject, PrintWriter oWriter) throws IOException
InstallationDescriptor
object in XML format to a given
PrintWriter
.insdObject
- The given InstallationDescriptor
object.oWriter
- The given PrintWriter
object.IOException
- if any I/O exception occurred.public static void saveInstallationDescriptor(InstallationDescriptor insdObject, File xmlFile) throws IOException
InstallationDescriptor
object in a given XML file.insdObject
- The given InstallationDescriptor
object.xmlFile
- The given XML file.IOException
- if any I/O exception occurred.public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
ch
- The characters.start
- The start position in the character array.length
- The number of characters to use from the character array.SAXException
- Any SAX exception, possibly wrapping another exception.public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
- Any SAX exception, possibly wrapping another exception.public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
uri
- The element URI.localName
- The element type name.qName
- The qualified name of the element.SAXException
- Any SAX exception, possibly wrapping another exception.public void error(SAXParseException ex) throws SAXException
error
in interface ErrorHandler
error
in class DefaultHandler
SAXException
public void fatalError(SAXParseException ex) throws SAXException
fatalError
in interface ErrorHandler
fatalError
in class DefaultHandler
SAXException
public InstallationDescriptor getInstallationDescriptor()
InstallationDescriptor
object after the installation descriptor file has
been loaded, or null
, if the file was not loaded.public void parse(File xmlFile) throws IOException, SAXException
xmlFile
- The given XML file.IOException
- Any I/O exception.SAXException
- Any SAX exception, possibly wrapping another exception.public void parse(InputStream xmlStream) throws IOException, SAXException
xmlStream
- The given XML input stream.IOException
- if any I/O exception occurred.SAXException
- Any SAX exception, possibly wrapping another exception.public void parseInstallationDescriptor(JarFile pearFile) throws IOException, SAXException
pearFile
- The given PEAR (JAR) file.IOException
- if any I/O exception occurred.SAXException
- Any SAX exception, possibly wrapping another exception.public void saveInstallationDescriptor(File xmlFile) throws IOException
InstallationDescriptor
object to a given XML file.xmlFile
- The given XML file.IOException
- if any I/O exception occurred.public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
- Any SAX exception, possibly wrapping another exception.public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
uri
- The element URI.localName
- The element type name.qName
- The qualified name of the element.attributes
- The specified or defaulted attributes.SAXException
- Any SAX exception, possibly wrapping another exception.public void warning(SAXParseException ex) throws SAXException
warning
in interface ErrorHandler
warning
in class DefaultHandler
SAXException
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.