org.apache.commons.jelly.tags.betwixt
Class ParseTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.betwixt.ParseTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag

public class ParseTag
extends org.apache.commons.jelly.TagSupport

Parses some XML specified via the given URI (which can be relative or an absolute URL) and outputs the parsed object. Typically this tag is customized by setting the introspector attribute or nesting a child introspector tag inside it.

Version:
$Revision: 155420 $
Author:
James Strachan

Field Summary
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
ParseTag()
           
 
Method Summary
 void doTag(org.apache.commons.jelly.XMLOutput output)
           
protected  java.lang.ClassLoader getClassLoader()
           
 org.apache.commons.betwixt.XMLIntrospector getIntrospector()
           
 void setClassLoader(java.lang.ClassLoader classLoader)
          Sets the ClassLoader to be used to load bean classes from.
 void setIntrospector(org.apache.commons.betwixt.XMLIntrospector introspector)
          Sets the Betwixt XMLIntrospector instance used to define the metadata for how a bean should appear as XML.
 void setPath(java.lang.String path)
          Sets the path that the root class should be bound to.
 void setRootClass(java.lang.String rootClass)
          Sets the name of the root class to use for parsing the XML
 void setUri(java.lang.String uri)
          Sets the URI from which XML is parsed.
 void setUseContextClassLoader(boolean useContextClassLoader)
          Sets whether or not the current threads's context class loader should be used to load the bean classes or not.
 void setVar(java.lang.String var)
          Sets the variable name to output with the result of the XML parse.
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseTag

public ParseTag()
Method Detail

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.MissingAttributeException,
                  org.apache.commons.jelly.JellyTagException
Throws:
org.apache.commons.jelly.MissingAttributeException
org.apache.commons.jelly.JellyTagException

getIntrospector

public org.apache.commons.betwixt.XMLIntrospector getIntrospector()
Returns:
the introspector to be used, lazily creating one if required.

setIntrospector

public void setIntrospector(org.apache.commons.betwixt.XMLIntrospector introspector)
Sets the Betwixt XMLIntrospector instance used to define the metadata for how a bean should appear as XML.


setUri

public void setUri(java.lang.String uri)
Sets the URI from which XML is parsed. This can be relative to this Jelly script, use an absolute URI or a full URL


setVar

public void setVar(java.lang.String var)
Sets the variable name to output with the result of the XML parse.


setRootClass

public void setRootClass(java.lang.String rootClass)
Sets the name of the root class to use for parsing the XML


setPath

public void setPath(java.lang.String path)
Sets the path that the root class should be bound to. This is optional and often unnecessary though can be used to ignore some wrapping elements, such as the <rss> element in the RSS unit test.


setUseContextClassLoader

public void setUseContextClassLoader(boolean useContextClassLoader)
Sets whether or not the current threads's context class loader should be used to load the bean classes or not. This can be useful if running inside a web application or inside some application server.


setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)
Sets the ClassLoader to be used to load bean classes from. If this is not specified then either the ClassLoader used to load this tag library is used or, if the 'useContextClassLoader' property is true, then the current threads context class loader is used instead.


getClassLoader

protected java.lang.ClassLoader getClassLoader()
Returns:
the ClassLoader to be used to load bean classes.


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.