|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.cocoon.components.source.util.SourceUtil
This class contains some utility methods for the source resolving.
| Field Summary | |
protected static REProgram |
uripattern
|
| Constructor Summary | |
SourceUtil()
|
|
| Method Summary | |
static String |
getAuthority(String uri)
Return the authority of a URI. |
static String |
getFragment(String uri)
Return the fragment of a URI. |
static InputSource |
getInputSource(Source source)
Get an InputSource object |
static String |
getPath(String uri)
Return the path of a URI. |
static String |
getPathWithoutAuthority(String uri)
Return the path of a URI, if the URI can't contains a authority. |
static String |
getQuery(String uri)
Return the query of a URI. |
static String |
getScheme(String uri)
Return the scheme of a URI. |
static Source |
getSource(String uri,
Parameters typeParameters,
SourceParameters resourceParameters,
SourceResolver resolver)
Get a Source object |
static org.apache.cocoon.ProcessingException |
handle(SourceException se)
Make a ProcessingException from a SourceException. |
static org.apache.cocoon.ProcessingException |
handle(String message,
SourceException se)
Make a ProcessingException from a SourceException. |
static void |
handleSAXException(String source,
SAXException e)
Handle SAXException catched in Generator's generate method. |
static void |
parse(org.apache.cocoon.core.xml.SAXParser parser,
Source source,
ContentHandler handler)
Generates SAX events from the given source by parsing it. |
static void |
parse(ServiceManager manager,
Source source,
ContentHandler handler)
Deprecated. use parse(SAXParser, Source, ContentHandler) instead |
static void |
toCharacters(Source source,
String encoding,
ContentHandler handler)
Generates character SAX events from the given source. |
static Document |
toDOM(ServiceManager manager,
Source source)
Generates a DOM from the given source |
static Document |
toDOM(ServiceManager manager,
String mimeTypeHint,
Source source)
Generates a DOM from the given source |
static void |
toSAX(ServiceManager manager,
Source source,
ContentHandler handler)
Generates SAX events from the given source. |
static void |
toSAX(ServiceManager manager,
Source source,
ContentHandler handler,
Parameters typeParameters,
boolean filterDocumentEvent)
Generates SAX events from the given source with possible URL rewriting. |
static void |
toSAX(ServiceManager manager,
Source source,
String mimeTypeHint,
ContentHandler handler)
Generates SAX events from the given source by using XMLizer. |
static void |
toSAX(XMLizable source,
ContentHandler handler)
Generates SAX events from the XMLizable and handle SAXException. |
static void |
toSAX(XMLizer xmlizer,
Source source,
String mimeTypeHint,
ContentHandler handler)
Generates SAX events from the given source by using XMLizer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static REProgram uripattern
| Constructor Detail |
public SourceUtil()
| Method Detail |
public static void toSAX(ServiceManager manager,
Source source,
ContentHandler handler,
Parameters typeParameters,
boolean filterDocumentEvent)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
NOTE: If the implementation can produce lexical events,
care should be taken that handler can actually
directly implement the LexicalHandler interface!
source - the data
org.apache.cocoon.ProcessingException - if no suitable converter is found
SAXException
IOException
public static void toSAX(XMLizable source,
ContentHandler handler)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
source - the data
SAXException
IOException
org.apache.cocoon.ProcessingException
public static void toSAX(ServiceManager manager,
Source source,
ContentHandler handler)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
NOTE: If the implementation can produce lexical events,
care should be taken that handler can actually
directly implement the LexicalHandler interface!
source - the data
org.apache.cocoon.ProcessingException - if no suitable converter is found
SAXException
IOException
public static void toSAX(ServiceManager manager,
Source source,
String mimeTypeHint,
ContentHandler handler)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
NOTE: If the implementation can produce lexical events,
care should be taken that handler can actually
directly implement the LexicalHandler interface!
source - the data
org.apache.cocoon.ProcessingException - if no suitable converter is found
SAXException
IOException
public static void toSAX(XMLizer xmlizer,
Source source,
String mimeTypeHint,
ContentHandler handler)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
NOTE: If the implementation can produce lexical events,
care should be taken that handler can actually
directly implement the LexicalHandler interface!
source - the data
org.apache.cocoon.ProcessingException - if no suitable converter is found
SAXException
IOException
public static void toCharacters(Source source,
String encoding,
ContentHandler handler)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
source - The dataencoding - The character encoding of the data
SAXException
IOException
org.apache.cocoon.ProcessingException
public static void parse(ServiceManager manager,
Source source,
ContentHandler handler)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
parse(SAXParser, Source, ContentHandler) instead
NOTE: If the implementation can produce lexical events,
care should be taken that handler can actually
directly implement the LexicalHandler interface!
source - the data
org.apache.cocoon.ProcessingException - if no suitable converter is found
SAXException
IOException
public static void parse(org.apache.cocoon.core.xml.SAXParser parser,
Source source,
ContentHandler handler)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
NOTE: If the implementation can produce lexical events,
care should be taken that handler can actually
directly implement the LexicalHandler interface!
source - the data
org.apache.cocoon.ProcessingException - if error during processing source data occurs
SAXException
IOException
public static Document toDOM(ServiceManager manager,
Source source)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
source - The data
IOException - If a io exception occurs.
org.apache.cocoon.ProcessingException - if no suitable converter is found
SAXException - If a SAX exception occurs.
public static Document toDOM(ServiceManager manager,
String mimeTypeHint,
Source source)
throws SAXException,
IOException,
org.apache.cocoon.ProcessingException
source - The data
IOException - If a io exception occurs.
org.apache.cocoon.ProcessingException - if no suitable converter is found
SAXException - If a SAX exception occurs.public static org.apache.cocoon.ProcessingException handle(SourceException se)
se - Source exception
public static org.apache.cocoon.ProcessingException handle(String message,
SourceException se)
message - Additional exception message.se - Source exception.
public static void handleSAXException(String source,
SAXException e)
throws org.apache.cocoon.ProcessingException,
IOException,
SAXException
source - Generator's sourcee - SAXException happened in the generator's generate method.
org.apache.cocoon.ProcessingException
IOException
SAXException
public static InputSource getInputSource(Source source)
throws IOException,
org.apache.cocoon.ProcessingException
source - Source.
IOException - If a io exception occurs.
org.apache.cocoon.ProcessingException - If an exception occurs during
processing.
public static Source getSource(String uri,
Parameters typeParameters,
SourceParameters resourceParameters,
SourceResolver resolver)
throws IOException,
SAXException,
SourceException
Source object
uri - URI of the source.typeParameters - Type of Source query. Currently, only
method parameter (value typically GET or
POST) is recognized. May be null.resourceParameters - Parameters of the source. May be nullresolver - Resolver for the source.
IOException - If a io exception occurs.
SAXException - If a SAX exception occurs.
SourceException - If the source an exception throws.public static String getScheme(String uri)
uri - Uniform resource identifier.
public static String getAuthority(String uri)
uri - Uniform resource identifier.
public static String getPath(String uri)
uri - Uniform resource identifier.
public static String getPathWithoutAuthority(String uri)
uri - Uniform resource identifier.
public static String getQuery(String uri)
uri - Uniform resource identifier.
public static String getFragment(String uri)
uri - Uniform resource identifier.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||