org.apache.cocoon.components.source.impl
Class EmptySource

java.lang.Object
  extended byorg.apache.cocoon.components.source.impl.EmptySource
All Implemented Interfaces:
Source, XMLizable

public class EmptySource
extends Object
implements XMLizable, Source

A Source that generates completely empty XML document or an XML document that contains just a root node.

The URI syntax is empty: for completely empty XML document or create-document:root-element for document with root element, where root-element is the name of the root element to create.

Since:
2.1.8
Version:
$Id: EmptySource.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
protected  String rootElementName
           
protected  String scheme
           
protected  String uri
           
protected  String xmlDocument
           
 
Constructor Summary
EmptySource(String location)
           
 
Method Summary
 boolean exists()
           
 long getContentLength()
           
 InputStream getInputStream()
           
 long getLastModified()
           
 String getMimeType()
           
 String getScheme()
           
 String getURI()
           
 SourceValidity getValidity()
           
 void refresh()
           
 void toSAX(ContentHandler handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootElementName

protected String rootElementName

scheme

protected String scheme

uri

protected String uri

xmlDocument

protected String xmlDocument
Constructor Detail

EmptySource

public EmptySource(String location)
Method Detail

toSAX

public void toSAX(ContentHandler handler)
           throws SAXException
Specified by:
toSAX in interface XMLizable
Throws:
SAXException
See Also:
XMLizable.toSAX(org.xml.sax.ContentHandler)

exists

public boolean exists()
Specified by:
exists in interface Source
See Also:
Source.exists()

getContentLength

public long getContentLength()
Specified by:
getContentLength in interface Source
See Also:
Source.getContentLength()

getInputStream

public InputStream getInputStream()
                           throws IOException,
                                  SourceNotFoundException
Specified by:
getInputStream in interface Source
Throws:
IOException
SourceNotFoundException
See Also:
Source.getInputStream()

getLastModified

public long getLastModified()
Specified by:
getLastModified in interface Source
See Also:
Source.getLastModified()

getMimeType

public String getMimeType()
Specified by:
getMimeType in interface Source
See Also:
Source.getMimeType()

getScheme

public String getScheme()
Specified by:
getScheme in interface Source
See Also:
Source.getScheme()

getURI

public String getURI()
Specified by:
getURI in interface Source
See Also:
Source.getURI()

getValidity

public SourceValidity getValidity()
Specified by:
getValidity in interface Source
See Also:
Source.getValidity()

refresh

public void refresh()
Specified by:
refresh in interface Source
See Also:
Source.refresh()


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.