|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jelly.impl.TagScript
public class TagScript
TagScript
is a Script that evaluates a custom tag.
Field Summary | |
---|---|
protected java.util.Map |
attributes
The attribute expressions that are created |
private int |
columnNumber
the column number of the tag |
private java.lang.String |
elementName
the qualified element name which caused the problem |
private java.lang.String |
fileName
the Jelly file which caused the problem |
private int |
lineNumber
the line number of the tag |
private java.lang.String |
localName
the local (non-namespaced) tag name |
private static org.apache.commons.logging.Log |
log
The Log to which logging calls will be made. |
private java.util.Map |
namespaceContext
The optional namespace context mapping all prefixes -> URIs in scope at the point this tag is used. |
private TagScript |
parent
the parent TagScript |
private org.xml.sax.Attributes |
saxAttributes
the SAX attributes |
private java.net.URL |
scriptURL
the url of the script when parsed |
private Script |
tagBody
the body script used for this tag |
private TagFactory |
tagFactory
the factory of Tag instances |
private java.util.Map |
tagNamespacesMap
the optional namespaces Map of prefix -> URI of this single Tag |
private java.util.Map |
threadLocalTagCache
A synchronized WeakHashMap from the current Thread (key) to a Tag object (value). |
Constructor Summary | |
---|---|
TagScript()
|
|
TagScript(TagFactory tagFactory)
|
Method Summary | |
---|---|
void |
addAttribute(java.lang.String name,
Expression expression)
Add an initialization attribute for the tag. |
protected void |
applyLocation(LocationAware locationAware)
|
Script |
compile()
Compiles the tags body |
protected void |
configureTag(Tag tag,
JellyContext context)
Compiles a newly created tag if required, sets its parent and body. |
protected java.lang.Object |
convertType(java.lang.Object value,
java.lang.Class requiredType)
Converts the given value to the required type. |
protected JellyException |
createJellyException(java.lang.String reason)
Creates a new Jelly exception, adorning it with location information |
protected JellyException |
createJellyException(java.lang.String reason,
java.lang.Exception cause)
Creates a new Jelly exception, adorning it with location information |
protected Tag |
createTag()
Factory method to create a new Tag instance. |
protected void |
endNamespacePrefixes(XMLOutput output)
End the new namespace prefixes mapped for the current element |
int |
getColumnNumber()
|
java.lang.String |
getElementName()
|
java.lang.String |
getFileName()
|
private java.net.URL |
getJellyContextURL(java.net.URL url)
Strips off the name of a script to create a new context URL FIXME: Copied from JellyContext |
int |
getLineNumber()
|
java.lang.String |
getLocalName()
Returns the local, non namespaced XML name of this tag |
java.util.Map |
getNamespaceContext()
Returns the namespace context of this tag. |
TagScript |
getParent()
Returns the parent. |
org.xml.sax.Attributes |
getSaxAttributes()
Returns the SAX attributes of this tag |
Tag |
getTag(JellyContext context)
|
Script |
getTagBody()
Returns the tagBody. |
TagFactory |
getTagFactory()
Returns the Factory of Tag instances. |
protected void |
handleException(java.lang.Error e)
A helper method to handle this non-Jelly exception. |
protected void |
handleException(java.lang.Exception e)
A helper method to handle this non-Jelly exception. |
protected void |
handleException(JellyException e)
A helper method to handle this Jelly exception. |
protected void |
handleException(JellyTagException e)
A helper method to handle this Jelly exception. |
static TagScript |
newInstance(java.lang.Class tagClass)
|
void |
run(JellyContext context,
XMLOutput output)
Evaluates the body of a tag |
void |
setColumnNumber(int columnNumber)
Sets the column number of the tag |
protected void |
setContextURLs(JellyContext context)
Set the context's root and current URL if not present |
void |
setElementName(java.lang.String elementName)
Sets the element name which caused the problem |
void |
setFileName(java.lang.String fileName)
Sets the Jelly file which caused the problem |
void |
setLineNumber(int lineNumber)
Sets the line number of the tag |
void |
setLocalName(java.lang.String localName)
Sets the local, non namespaced name of this tag. |
void |
setLocator(org.xml.sax.Locator locator)
Configures this TagScript from the SAX Locator, setting the column and line numbers |
void |
setParent(TagScript parent)
Sets the parent. |
void |
setSaxAttributes(org.xml.sax.Attributes saxAttributes)
Sets the SAX attributes of this tag |
protected void |
setTag(Tag tag,
JellyContext context)
Allows the script to set the tag instance to be used, such as in a StaticTagScript when a StaticTag is switched with a DynamicTag |
void |
setTagBody(Script tagBody)
Sets the tagBody. |
void |
setTagFactory(TagFactory tagFactory)
Sets the Factory of Tag instances. |
void |
setTagNamespacesMap(java.util.Map tagNamespacesMap)
Sets the optional namespaces prefix -> URI map of the namespaces attached to this Tag |
protected void |
startNamespacePrefixes(XMLOutput output)
Output the new namespace prefixes used for this element |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
protected java.util.Map attributes
private java.util.Map tagNamespacesMap
private java.util.Map namespaceContext
private java.lang.String fileName
private java.lang.String elementName
private java.lang.String localName
private int lineNumber
private int columnNumber
private TagFactory tagFactory
private Script tagBody
private TagScript parent
private org.xml.sax.Attributes saxAttributes
private java.net.URL scriptURL
private java.util.Map threadLocalTagCache
Constructor Detail |
---|
public TagScript()
public TagScript(TagFactory tagFactory)
Method Detail |
---|
public static TagScript newInstance(java.lang.Class tagClass)
public java.lang.String toString()
toString
in class java.lang.Object
public Script compile() throws JellyException
compile
in interface Script
JellyException
public void setTagNamespacesMap(java.util.Map tagNamespacesMap)
public void setLocator(org.xml.sax.Locator locator)
public void addAttribute(java.lang.String name, Expression expression)
private java.net.URL getJellyContextURL(java.net.URL url) throws java.net.MalformedURLException
java.net.MalformedURLException
public void run(JellyContext context, XMLOutput output) throws JellyTagException
run
in interface Script
JellyTagException
protected void setContextURLs(JellyContext context) throws JellyTagException
context
-
JellyTagException
public Tag getTag(JellyContext context) throws JellyException
JellyException
public TagFactory getTagFactory()
public void setTagFactory(TagFactory tagFactory)
tagFactory
- The factory to setpublic TagScript getParent()
public Script getTagBody()
public void setParent(TagScript parent)
parent
- The parent to setpublic void setTagBody(Script tagBody)
tagBody
- The tagBody to setpublic java.lang.String getFileName()
public void setFileName(java.lang.String fileName)
public java.lang.String getElementName()
public void setElementName(java.lang.String elementName)
public int getLineNumber()
public void setLineNumber(int lineNumber)
public int getColumnNumber()
public void setColumnNumber(int columnNumber)
public org.xml.sax.Attributes getSaxAttributes()
public void setSaxAttributes(org.xml.sax.Attributes saxAttributes)
saxAttributes
- The saxAttributes to setpublic java.lang.String getLocalName()
public void setLocalName(java.lang.String localName)
localName
- The localName to setpublic java.util.Map getNamespaceContext()
protected Tag createTag() throws JellyException
JellyException
protected void configureTag(Tag tag, JellyContext context) throws JellyException
JellyException
protected void setTag(Tag tag, JellyContext context)
protected void startNamespacePrefixes(XMLOutput output) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void endNamespacePrefixes(XMLOutput output) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected java.lang.Object convertType(java.lang.Object value, java.lang.Class requiredType) throws JellyException
value
- is the value to be converted. This will not be nullrequiredType
- the type that the value should be converted to
JellyException
protected JellyException createJellyException(java.lang.String reason)
protected JellyException createJellyException(java.lang.String reason, java.lang.Exception cause)
protected void handleException(JellyTagException e) throws JellyTagException
JellyTagException
protected void handleException(JellyException e) throws JellyTagException
JellyTagException
protected void applyLocation(LocationAware locationAware)
protected void handleException(java.lang.Exception e) throws JellyTagException
JellyTagException
protected void handleException(java.lang.Error e) throws java.lang.Error, JellyTagException
java.lang.Error
JellyTagException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |