|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.cargo.module.AbstractDescriptorIo
public abstract class AbstractDescriptorIo
Provides convenience methods for reading and writing descriptors.
Constructor Summary | |
---|---|
protected |
AbstractDescriptorIo(DescriptorType descriptorType)
Constructor. |
Method Summary | |
---|---|
org.jdom.input.SAXBuilder |
createDocumentBuilder()
Create a document builder. |
org.jdom.input.SAXBuilder |
createDocumentBuilder(org.xml.sax.EntityResolver theEntityResolver)
|
protected org.xml.sax.EntityResolver |
getEntityResolver()
Get the default entity resolver for this type. |
org.jdom.Document |
parseXml(java.io.InputStream input)
Parse XML into a document. |
org.jdom.Document |
parseXml(java.io.InputStream input,
org.xml.sax.EntityResolver resolver)
Create a document from the input stream and resolver. |
static java.io.File[] |
writeAll(J2eeDescriptor descriptor,
java.lang.String dir)
Writes the WebXml and its associated vendor descriptors to the specified directory. |
static void |
writeDescriptor(Descriptor descriptor,
java.io.File file)
Writes the specified document to a file. |
static void |
writeDescriptor(Descriptor descriptor,
java.io.File file,
java.lang.String encoding)
Writes the specified document to a file. |
static void |
writeDescriptor(Descriptor descriptor,
java.io.File file,
java.lang.String encoding,
boolean isIndent)
Writes the specified document to a file. |
static void |
writeDescriptor(Descriptor descriptor,
java.io.OutputStream out,
java.lang.String encoding,
boolean isIndent)
Writes the specified document to an output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractDescriptorIo(DescriptorType descriptorType)
descriptorType
- the descriptor type.Method Detail |
---|
public org.jdom.input.SAXBuilder createDocumentBuilder()
createDocumentBuilder
in interface DescriptorIo
public org.jdom.input.SAXBuilder createDocumentBuilder(org.xml.sax.EntityResolver theEntityResolver)
createDocumentBuilder
in interface DescriptorIo
theEntityResolver
- entity resolver or null
DocumentBuilder
instanceprotected org.xml.sax.EntityResolver getEntityResolver()
public org.jdom.Document parseXml(java.io.InputStream input) throws org.jdom.JDOMException, java.io.IOException
DescriptorIo
parseXml
in interface DescriptorIo
input
- the input stream
java.io.IOException
- if problem reading the stream
org.jdom.JDOMException
- if problem parsing the streampublic org.jdom.Document parseXml(java.io.InputStream input, org.xml.sax.EntityResolver resolver) throws org.jdom.JDOMException, java.io.IOException
parseXml
in interface DescriptorIo
input
- the input streamresolver
- entity resolver, or null
java.io.IOException
- if problem reading the stream
org.jdom.JDOMException
- if problem parsing the streampublic static void writeDescriptor(Descriptor descriptor, java.io.File file) throws java.io.IOException
descriptor
- The descriptor to serializefile
- The file to write to
java.io.IOException
- If an I/O error occurspublic static void writeDescriptor(Descriptor descriptor, java.io.File file, java.lang.String encoding) throws java.io.IOException
descriptor
- The descriptor to serializefile
- The file to write toencoding
- The character encoding to use
java.io.IOException
- If an I/O error occurspublic static void writeDescriptor(Descriptor descriptor, java.io.File file, java.lang.String encoding, boolean isIndent) throws java.io.IOException
descriptor
- The descriptor to serializefile
- The file to write toencoding
- The character encoding to useisIndent
- Whether the written XML should be indented
java.io.IOException
- If an I/O error occurspublic static void writeDescriptor(Descriptor descriptor, java.io.OutputStream out, java.lang.String encoding, boolean isIndent) throws java.io.IOException
descriptor
- The descriptor to serializeout
- The output stream to write toencoding
- The character encoding to useisIndent
- Whether the written XML should be indented
java.io.IOException
- If an I/O error occurspublic static java.io.File[] writeAll(J2eeDescriptor descriptor, java.lang.String dir) throws java.io.IOException
descriptor
- The descriptor to serializedir
- Directory to store the descriptors in
java.io.IOException
- if a I/O error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |