public abstract class AbstractDescriptorIo extends Object implements DescriptorIo
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDescriptorIo(DescriptorType descriptorType)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
org.jdom.input.SAXBuilder |
createDocumentBuilder()
Create a document builder.
|
org.jdom.input.SAXBuilder |
createDocumentBuilder(EntityResolver theEntityResolver) |
protected EntityResolver |
getEntityResolver()
Get the default entity resolver for this type.
|
org.jdom.Document |
parseXml(InputStream input)
Parse XML into a document.
|
org.jdom.Document |
parseXml(InputStream input,
EntityResolver resolver)
Create a document from the input stream and resolver.
|
static File[] |
writeAll(J2eeDescriptor descriptor,
String dir)
Writes the WebXml and its associated vendor descriptors to the specified directory.
|
static void |
writeDescriptor(Descriptor descriptor,
File file)
Writes the specified document to a file.
|
static void |
writeDescriptor(Descriptor descriptor,
File file,
String encoding)
Writes the specified document to a file.
|
static void |
writeDescriptor(Descriptor descriptor,
File file,
String encoding,
boolean isIndent)
Writes the specified document to a file.
|
static void |
writeDescriptor(Descriptor descriptor,
OutputStream out,
String encoding,
boolean isIndent)
Writes the specified document to an output stream.
|
protected AbstractDescriptorIo(DescriptorType descriptorType)
descriptorType - the descriptor type.public org.jdom.input.SAXBuilder createDocumentBuilder()
createDocumentBuilder in interface DescriptorIopublic org.jdom.input.SAXBuilder createDocumentBuilder(EntityResolver theEntityResolver)
createDocumentBuilder in interface DescriptorIotheEntityResolver - entity resolver or nullDocumentBuilder instanceprotected EntityResolver getEntityResolver()
public org.jdom.Document parseXml(InputStream input) throws org.jdom.JDOMException, IOException
DescriptorIoparseXml in interface DescriptorIoinput - the input streamIOException - if problem reading the streamorg.jdom.JDOMException - if problem parsing the streampublic org.jdom.Document parseXml(InputStream input, EntityResolver resolver) throws org.jdom.JDOMException, IOException
parseXml in interface DescriptorIoinput - the input streamresolver - entity resolver, or nullIOException - if problem reading the streamorg.jdom.JDOMException - if problem parsing the streampublic static void writeDescriptor(Descriptor descriptor, File file) throws IOException
descriptor - The descriptor to serializefile - The file to write toIOException - If an I/O error occurspublic static void writeDescriptor(Descriptor descriptor, File file, String encoding) throws IOException
descriptor - The descriptor to serializefile - The file to write toencoding - The character encoding to useIOException - If an I/O error occurspublic static void writeDescriptor(Descriptor descriptor, File file, String encoding, boolean isIndent) throws IOException
descriptor - The descriptor to serializefile - The file to write toencoding - The character encoding to useisIndent - Whether the written XML should be indentedIOException - If an I/O error occurspublic static void writeDescriptor(Descriptor descriptor, OutputStream out, String encoding, boolean isIndent) throws IOException
descriptor - The descriptor to serializeout - The output stream to write toencoding - The character encoding to useisIndent - Whether the written XML should be indentedIOException - If an I/O error occurspublic static File[] writeAll(J2eeDescriptor descriptor, String dir) throws IOException
descriptor - The descriptor to serializedir - Directory to store the descriptors inIOException - if a I/O error occursCopyright © 2004-2013 Codehaus. All Rights Reserved.