org.apache.cocoon.components.xscript
Class XScriptObject

java.lang.Object
  extended by org.apache.cocoon.components.xscript.XScriptObject
All Implemented Interfaces:
Serviceable, Source
Direct Known Subclasses:
XScriptObjectFromURL, XScriptObjectInlineXML, XScriptObjectResult

public abstract class XScriptObject
extends Object
implements Source, Serviceable

XScriptObject is the root class implemented by all the object types in XScript. Every XScriptObject is essentially a Source object.

Since:
August 4, 2001
Version:
CVS $Id: XScriptObject.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Ovidiu Predescu

Field Summary
protected  ServiceManager serviceManager
           
 
Constructor Summary
XScriptObject(XScriptManager manager)
          Creates a new XScriptObject instance.
 
Method Summary
 boolean exists()
           
abstract  long getContentLength()
           
 InputSource getInputSource()
           
 long getLastModified()
           
 String getMimeType()
           
 String getScheme()
           
 SourceValidity getValidity()
           
 void recycle()
           
 void refresh()
           
 void service(ServiceManager manager)
           
 void toEmbeddedSAX(ContentHandler handler)
           
 void toSAX(ContentHandler handler)
           
 XScriptObject transform(XScriptObject stylesheet, Parameters params)
          Apply the XSLT stylesheet defined by the stylesheet variable to this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.excalibur.source.Source
getInputStream, getURI
 

Field Detail

serviceManager

protected ServiceManager serviceManager
Constructor Detail

XScriptObject

public XScriptObject(XScriptManager manager)
Creates a new XScriptObject instance.

Parameters:
manager - a XScriptManager value
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

transform

public XScriptObject transform(XScriptObject stylesheet,
                               Parameters params)
                        throws IllegalArgumentException,
                               ProcessingException
Apply the XSLT stylesheet defined by the stylesheet variable to this instance. Return the result of the transformation as an XScriptObject.

Parameters:
stylesheet - a XScriptObject value
params - a Parameters value containing optional arguments to be passed to the XSLT processor.
Returns:
XScriptObject object containing the result of the XSLT processing.
Throws:
IllegalArgumentException - if an error occurs
ProcessingException - if an error occurs

toEmbeddedSAX

public void toEmbeddedSAX(ContentHandler handler)
                   throws SAXException
Throws:
SAXException

toSAX

public void toSAX(ContentHandler handler)
           throws SAXException
Throws:
SAXException

getLastModified

public long getLastModified()
Specified by:
getLastModified in interface Source

getContentLength

public abstract long getContentLength()
Specified by:
getContentLength in interface Source

getInputSource

public InputSource getInputSource()
                           throws ProcessingException,
                                  IOException
Throws:
ProcessingException
IOException

recycle

public void recycle()

getScheme

public String getScheme()
Specified by:
getScheme in interface Source

refresh

public void refresh()
Specified by:
refresh in interface Source

getMimeType

public String getMimeType()
Specified by:
getMimeType in interface Source

getValidity

public SourceValidity getValidity()
Specified by:
getValidity in interface Source

exists

public boolean exists()
Specified by:
exists in interface Source


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.