org.apache.commons.betwixt.digester
Class XMLBeanInfoDigester

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.apache.commons.digester.Digester
          extended byorg.apache.commons.betwixt.digester.XMLBeanInfoDigester
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class XMLBeanInfoDigester
extends Digester

XMLBeanInfoDigester is a digester of XML files containing XMLBeanInfo definitions for a JavaBean.

Version:
$Revision: 1.3 $
Author:
James Strachan

Field Summary
private  boolean attributesForPrimitives
          should attributes or elements be used for primitive types
private  Class beanClass
          the beans class for this XML descriptor
private  XMLIntrospector introspector
          the introspector that is using me
private static Log log
          Logger
private  Set processedPropertyNameSet
          the set of property names processed so far
 
Fields inherited from class org.apache.commons.digester.Digester
bodyText, bodyTexts, classLoader, configured, entityResolver, entityValidator, errorHandler, factory, JAXP_SCHEMA_LANGUAGE, locator, match, namespaceAware, namespaces, params, parser, publicId, reader, root, rules, saxLog, schemaLanguage, schemaLocation, stack, useContextClassLoader, validating, W3C_XML_SCHEMA
 
Constructor Summary
XMLBeanInfoDigester()
          Construct a new XMLBeanInfoDigester with default properties.
XMLBeanInfoDigester(SAXParser parser)
          Construct a new XMLBeanInfoDigester, allowing a SAXParser to be passed in.
XMLBeanInfoDigester(XMLReader reader)
          Construct a new XMLBeanInfoDigester, allowing an XMLReader to be passed in.
 
Method Summary
protected  void configure()
          Reset configure for new digestion
 Class getBeanClass()
          Gets the class of the bean whose .betwixt file is being processed
 Set getProcessedPropertyNameSet()
          Gets the property names already processed
 XMLIntrospector getXMLIntrospector()
          Gets the XMLIntrospector that's using this digester.
 boolean isAttributesForPrimitives()
          Should attributes (or elements) be used for primitive types?
 void setAttributesForPrimitives(boolean attributesForPrimitives)
          Set whether attributes (or elements) should be used for primitive types.
 void setBeanClass(Class beanClass)
          Sets the beans class for this XML descriptor
 void setXMLIntrospector(XMLIntrospector introspector)
          Sets the introspector that is using me
 
Methods inherited from class org.apache.commons.digester.Digester
addBeanPropertySetter, addBeanPropertySetter, addCallMethod, addCallMethod, addCallMethod, addCallMethod, addCallParam, addCallParam, addCallParam, addCallParam, addFactoryCreate, addFactoryCreate, addFactoryCreate, addFactoryCreate, addFactoryCreate, addFactoryCreate, addFactoryCreate, addFactoryCreate, addFactoryCreate, addFactoryCreate, addObjectCreate, addObjectCreate, addObjectCreate, addObjectCreate, addRule, addRuleSet, addSetNext, addSetNext, addSetProperties, addSetProperties, addSetProperties, addSetProperty, addSetRoot, addSetRoot, addSetTop, addSetTop, characters, clear, createSAXException, createSAXException, createSAXException, endDocument, endElement, endPrefixMapping, error, fatalError, findNamespaceURI, getClassLoader, getCount, getCurrentElementName, getDebug, getDocumentLocator, getEntityResolver, getErrorHandler, getFactory, getFeature, getLogger, getMatch, getNamespaceAware, getParser, getProperty, getPublicId, getReader, getRoot, getRuleNamespaceURI, getRules, getSchema, getSchemaLanguage, getUseContextClassLoader, getValidating, getXMLReader, ignorableWhitespace, log, log, notationDecl, parse, parse, parse, parse, parse, peek, peek, pop, processingInstruction, push, register, resolveEntity, setClassLoader, setDebug, setDocumentLocator, setEntityResolver, setErrorHandler, setFeature, setLogger, setNamespaceAware, setProperty, setPublicId, setRuleNamespaceURI, setRules, setSchema, setSchemaLanguage, setUseContextClassLoader, setValidating, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final Log log
Logger


beanClass

private Class beanClass
the beans class for this XML descriptor


attributesForPrimitives

private boolean attributesForPrimitives
should attributes or elements be used for primitive types


processedPropertyNameSet

private Set processedPropertyNameSet
the set of property names processed so far


introspector

private XMLIntrospector introspector
the introspector that is using me

Constructor Detail

XMLBeanInfoDigester

public XMLBeanInfoDigester()
Construct a new XMLBeanInfoDigester with default properties.


XMLBeanInfoDigester

public XMLBeanInfoDigester(SAXParser parser)
Construct a new XMLBeanInfoDigester, allowing a SAXParser to be passed in. This allows XMLBeanInfoDigester to be used in environments which are unfriendly to JAXP1.1 (such as WebLogic 6.0). Thanks for the request to change go to James House (james@interobjective.com). This may help in places where you are able to load JAXP 1.1 classes yourself.

Parameters:
parser - the SAXParser to be used to parse the xml

XMLBeanInfoDigester

public XMLBeanInfoDigester(XMLReader reader)
Construct a new XMLBeanInfoDigester, allowing an XMLReader to be passed in. This allows XMLBeanInfoDigester to be used in environments which are unfriendly to JAXP1.1 (such as WebLogic 6.0). Note that if you use this option you have to configure namespace and validation support yourself, as these properties only affect the SAXParser and emtpy constructor.

Parameters:
reader - the XMLReader to be used to parse the xml
Method Detail

getBeanClass

public Class getBeanClass()
Gets the class of the bean whose .betwixt file is being processed

Returns:
the beans class for this XML descriptor

setBeanClass

public void setBeanClass(Class beanClass)
Sets the beans class for this XML descriptor

Parameters:
beanClass - the Class of the bean being processed

getProcessedPropertyNameSet

public Set getProcessedPropertyNameSet()
Gets the property names already processed

Returns:
the set of property names that have been processed so far

isAttributesForPrimitives

public boolean isAttributesForPrimitives()
Should attributes (or elements) be used for primitive types?

Returns:
true if primitive properties should be written as attributes in the xml

setAttributesForPrimitives

public void setAttributesForPrimitives(boolean attributesForPrimitives)
Set whether attributes (or elements) should be used for primitive types.

Parameters:
attributesForPrimitives - pass true if primitive properties should be written as attributes

getXMLIntrospector

public XMLIntrospector getXMLIntrospector()
Gets the XMLIntrospector that's using this digester.

Returns:
the introspector that is using me

setXMLIntrospector

public void setXMLIntrospector(XMLIntrospector introspector)
Sets the introspector that is using me

Parameters:
introspector - the XMLIntrospector that using this for .betwixt digestion

configure

protected void configure()
Reset configure for new digestion