org.apache.pluto.descriptors.services.castor
Class WebAppDescriptorServiceImpl

java.lang.Object
  extended by org.apache.pluto.descriptors.services.castor.WebAppDescriptorServiceImpl
All Implemented Interfaces:
WebAppDescriptorService

public class WebAppDescriptorServiceImpl
extends Object
implements WebAppDescriptorService

Abstract Implementation of the Web Application Deployment Descriptor service. Provides default implementation of the service; requiring only that subclasses provide the input streams to/from the actual descriptor.

Since:
Mar 5, 2005
Version:
$Id: WebAppDescriptorServiceImpl.java 156743 2005-03-10 05:50:30Z ddewolf $

Field Summary
protected static boolean USING_JAXP
          Whether or not Castor should use JAXP.
static String WEB_XML_MAPPING
           
 
Constructor Summary
WebAppDescriptorServiceImpl()
           
 
Method Summary
protected  org.exolab.castor.mapping.Mapping getCastorMapping()
          Read and Retrieve the Web Application's Castor Mapping resource.
protected  String getDTDUri()
          Retrieve the Web Application Deployment descriptor's DTD uri.
protected  boolean getIgnoreExtraElements()
           
protected  String getPublicId()
          Retrieve the Web Application Deployment descriptor's public Id.
 WebAppDD read(InputStream in)
          Read the Web Application Deployment Descriptor.
protected  Object readInternal(InputStream is)
          Read the and convert the descriptor into it's Object graph.
protected  void setCastorMarshallerOptions(org.exolab.castor.xml.Marshaller marshaller, Object beingMarshalled)
          Subclasses should override this method if they need to set options on the Castor marshaller, such as a doctype.
 void write(WebAppDD webApp, OutputStream out)
          Write the deployment descriptor.
protected  void writeInternal(Object object, OutputStream out)
          Write the object graph to it's descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEB_XML_MAPPING

public static final String WEB_XML_MAPPING
See Also:
Constant Field Values

USING_JAXP

protected static boolean USING_JAXP
Whether or not Castor should use JAXP. If Castor is not using JAXP, then default to the parser specified by org.exolab.castor.parser.

Constructor Detail

WebAppDescriptorServiceImpl

public WebAppDescriptorServiceImpl()
Method Detail

read

public WebAppDD read(InputStream in)
              throws IOException
Read the Web Application Deployment Descriptor.

Specified by:
read in interface WebAppDescriptorService
Returns:
WebAppDD instance representing the descriptor.
Throws:
IOException

write

public void write(WebAppDD webApp,
                  OutputStream out)
           throws IOException
Write the deployment descriptor.

Specified by:
write in interface WebAppDescriptorService
Parameters:
webApp -
out - output stream to which the descriptor should be written
Throws:
IOException

getPublicId

protected String getPublicId()
Retrieve the Web Application Deployment descriptor's public Id.

Returns:

getDTDUri

protected String getDTDUri()
Retrieve the Web Application Deployment descriptor's DTD uri.

Returns:

getCastorMapping

protected org.exolab.castor.mapping.Mapping getCastorMapping()
                                                      throws IOException,
                                                             org.exolab.castor.mapping.MappingException
Read and Retrieve the Web Application's Castor Mapping resource.

Returns:
Throws:
IOException
org.exolab.castor.mapping.MappingException

setCastorMarshallerOptions

protected void setCastorMarshallerOptions(org.exolab.castor.xml.Marshaller marshaller,
                                          Object beingMarshalled)
Subclasses should override this method if they need to set options on the Castor marshaller, such as a doctype.

Parameters:
marshaller - the Castor Marshaller
beingMarshalled - the Object being marshalled by Castor.

readInternal

protected Object readInternal(InputStream is)
                       throws IOException
Read the and convert the descriptor into it's Object graph.

Returns:
Throws:
IOException

writeInternal

protected void writeInternal(Object object,
                             OutputStream out)
                      throws IOException
Write the object graph to it's descriptor.

Parameters:
object -
Throws:
IOException

getIgnoreExtraElements

protected boolean getIgnoreExtraElements()


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.