|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvelosurf.util.XIncludeResolver
public class XIncludeResolver
A basic JDOM XInclude resolver that will also work with a document base inside WEB-INF and with war archives.
| Field Summary | |
|---|---|
private java.lang.String |
base
base directory |
private javax.servlet.ServletContext |
context
servlet context |
| Constructor Summary | |
|---|---|
XIncludeResolver(java.lang.String base)
Constructor outside a webapp. |
|
XIncludeResolver(java.lang.String base,
javax.servlet.ServletContext ctx)
Constructor for a webapp resolver. |
|
| Method Summary | |
|---|---|
private java.util.List<org.jdom.Content> |
include(org.jdom.Element xinclude)
Performs the real include. |
private boolean |
isXIncludeElement(org.jdom.Element element)
Check whether this element is an include element. |
private java.lang.String |
readStream(java.io.InputStream stream)
Read a stream in a string. |
org.jdom.Document |
resolve(org.jdom.Document doc)
Resolve includes in the document. |
private void |
resolveChildren(org.jdom.Element parent)
Resolve children XML elements. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String base
private javax.servlet.ServletContext context
| Constructor Detail |
|---|
public XIncludeResolver(java.lang.String base,
javax.servlet.ServletContext ctx)
base - base directoryctx - servlet contextpublic XIncludeResolver(java.lang.String base)
base - base directory| Method Detail |
|---|
public org.jdom.Document resolve(org.jdom.Document doc)
throws java.lang.Exception
doc - document to be resolved
java.lang.Exceptionprivate boolean isXIncludeElement(org.jdom.Element element)
element - element to check
private void resolveChildren(org.jdom.Element parent)
throws java.lang.Exception
parent - parent XML element
java.lang.Exception
private java.util.List<org.jdom.Content> include(org.jdom.Element xinclude)
throws java.lang.Exception
xinclude - xinclude element
java.lang.Exception
private java.lang.String readStream(java.io.InputStream stream)
throws java.lang.Exception
stream - stream
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||