Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.digester.parser.* (2)org.apache.commons.digester.plugins.* (45)
org.apache.commons.digester.plugins.strategies.* (11)org.apache.commons.digester.rss.* (5)
org.apache.commons.digester.substitution.* (6)org.apache.commons.digester.xmlrules.* (17)

org.apache.commons.digester: Javadoc index of package org.apache.commons.digester.


Package Samples:

org.apache.commons.digester.rss: Example usage of Digester to parse XML documents compatible with the Rich Site Summary format used by many newsfeeds.  
org.apache.commons.digester.xmlrules: The xmlrules package provides for XML-based definition of rules for Digester .  
org.apache.commons.digester.plugins.strategies: Provides an easy mechanism whereby new digestion rules can be added dynamically during a digestion.  
org.apache.commons.digester.parser: The Digester package provides for rules-based processing of arbitrary XML documents.  
org.apache.commons.digester.plugins
org.apache.commons.digester.substitution

Classes:

ExtendedBaseRules: Extension of RulesBase for complex schema. This is an extension of the basic pattern matching scheme intended to improve support for mapping complex xml-schema. It is intended to be a minimal extension of the standard rules big enough to support complex schema but without the full generality offered by more exotic matching pattern rules. When should you use this rather than the original? This pattern-matching engine is complex and slower than the basic default RulesBase class, but offers more functionality: Universal patterns allow patterns to be specified which will match regardless of whether ...
CallMethodRule: Rule implementation that calls a method on an object on the stack (normally the top/parent object), passing arguments collected from subsequent CallParamRule rules or from the body of this element. By using CallMethodRule(String methodName) 55 a method call can be made to a method which accepts no arguments. Incompatible method parameter types are converted using org.apache.commons.beanutils.ConvertUtils . This rule now uses MethodUtils.invokeMethod(java.lang.Object, java.lang.String, java.lang.Object) > MethodUtils.invokeMethod(java.lang.Object, java.lang.String, java.lang.Object) 55 by default. ...
SetNestedPropertiesRule: Rule implementation that sets properties on the object at the top of the stack, based on child elements with names matching properties on that object. Example input that can be processed by this rule: [widget] [height]7[/height] [width]8[/width] [label]Hello, world[/label] [/widget] For each child element of [widget], a corresponding setter method is located on the object on the top of the digester stack, the body text of the child element is converted to the type specified for the (sole) parameter to the setter method, then the setter method is invoked. This rule supports custom mapping of xml ...
NodeCreateRule: A rule implementation that creates a DOM Node containing the XML at the element that matched the rule. Two concrete types of nodes can be created by this rule: the default is to create an Element node. The created element will correspond to the element that matched the rule, containing all XML content underneath that element. alternatively, this rule can create nodes of type DocumentFragment , which will contain only the XML content under the element the rule was trigged on. The created node will be normalized, meaning it will not contain text nodes that only contain white space characters. The ...
LogUtils: Simple utility class to assist in logging. This class is intended only for the use of the code in the plugins packages. No "user" code should use this package. The Digester module has an interesting approach to logging: all logging should be done via the Log object stored on the digester instance that the object *doing* the logging is associated with. This is done because apparently some "container"-type applications such as Avalon and Tomcat need to be able to configure different logging for different instances of the Digester class which have been loaded from the same ClassLoader [info from Craig ...
PluginRules: A custom digester Rules manager which must be used as the Rules object when using the plugins module functionality. During parsing, a linked list of PluginCreateRule instances develop, and this list also acts like a stack. The original instance that was set before the Digester started parsing is always at the tail of the list, and the Digester always holds a reference to the instance at the head of the list in the rules member. Initially, this list/stack holds just one instance, ie head and tail are the same object. When the start of an xml element causes a PluginCreateRule to fire, a new PluginRules ...
RulesBase: Default implementation of the Rules interface that supports the standard rule matching behavior. This class can also be used as a base class for specialized Rules implementations. The matching policies implemented by this class support two different types of pattern matching rules: Exact Match - A pattern "a/b/c" exactly matches a <c> element, nested inside a <b> element, which is nested inside an <a> element. Tail Match - A pattern "*/a/b" matches a <b> element, nested inside an <a> element, no matter how deeply the pair is nested. Note that wildcard patterns ...
AbstractRulesImpl: AbstractRuleImpl provides basic services for Rules implementations. Extending this class should make it easier to create a Rules implementation. AbstractRuleImpl manages the Digester and namespaceUri properties. If the subclass overrides registerRule(java.lang.String, org.apache.commons.digester.Rule) 55 (rather than add(java.lang.String, org.apache.commons.digester.Rule) 55 ), then the Digester and namespaceURI of the Rule will be set correctly before it is passed to registerRule . The subclass can then perform whatever it needs to do to register the rule.
CallParamRule: Rule implementation that saves a parameter for use by a surrounding CallMethodRule . This parameter may be: from an attribute of the current element See CallParamRule(int paramIndex, String attributeName) 55 from current the element body See CallParamRule(int paramIndex) 55 from the top object on the stack. See CallParamRule(int paramIndex, boolean fromStack) 55 the current path being processed (separate Rule ). See PathCallParamRule
SetNextRule: Rule implementation that calls a method on the (top-1) (parent) object, passing the top object (child) as an argument. It is commonly used to establish parent-child relationships. This rule now supports more flexible method matching by default. It is possible that this may break (some) code written against release 1.1.1 or earlier. See isExactMatch() 55 for more details. Note that while CallMethodRule uses commons-beanutils' data-conversion functionality (ConvertUtils class) to convert parameter values into the appropriate type for the parameter to the called method, this rule does not. Needing ...
PluginAssertionFailure: Thrown when a bug is detected in the plugins code. This class is intended to be used in assertion statements, similar to the way that java 1.4's native assertion mechanism is used. However there is a difference: when a java 1.4 assertion fails, an AssertionError is thrown, which is a subclass of Error; here, the PluginAssertionFailure class extends RuntimeException rather than Error. This difference in design is because throwing Error objects is not good in a container-based architecture. Example: if (impossibleCondition) { throw new PluginAssertionFailure( "internal error: impossible condition ...
Digester: A Digester processes an XML input stream by matching a series of element nesting patterns to execute Rules that have been added prior to the start of parsing. This package was inspired by the XmlMapper class that was part of Tomcat 3.0 and 3.1, but is organized somewhat differently. See the Digester Developer Guide for more information. IMPLEMENTATION NOTE - A single Digester instance may only be used within the context of a single thread at a time, and a call to parse() must be completed before another can be initiated even from the same thread. IMPLEMENTATION NOTE - A bug in Xerces 2.0.2 prevents ...
RuleFinder: Each concrete implementation of RuleFinder is an algorithm for locating a source of digester rules for a plugin. The algorithm may use info explicitly provided by the user as part of the plugin declaration, or not (in which case the concrete RuleFinder subclass typically has Dflt as part of its name). Instances of this class can also be regarded as a Factory for RuleLoaders, except that an instance of a RuleLoader is only created if the particular finder algorithm can locate a suitable source of rules given the plugin class and associated properties. This is an abstract class rather than an interface ...
ObjectParamRule: Rule implementation that saves a parameter for use by a surrounding CallMethodRule . This parameter may be: an arbitrary Object defined programatically, assigned when the element pattern associated with the Rule is matched. See ObjectParamRule(int paramIndex, Object param) 55 . an arbitrary Object defined programatically, assigned if the element pattern AND specified attribute name are matched. See ObjectParamRule(int paramIndex, String attributeName, Object param) 55 .
RuleSet: Public interface defining a shorthand means of configuring a complete set of related Rule definitions, possibly associated with a particular namespace URI, in one operation. To use an instance of a class that imlements this interface: Create a concrete implementation of this interface. Optionally, you can configure a RuleSet to be relevant only for a particular namespace URI by configuring the value to be returned by getNamespaceURI() . As you are configuring your Digester instance, call digester.addRuleSet() and pass the RuleSet instance. Digester will call the addRuleInstances() method of your ...
WithDefaultsRulesWrapper: Rules Decorator that returns default rules when no matches are returned by the wrapped implementation. This allows default Rule instances to be added to any existing Rules implementation. These default Rule instances will be returned for any match for which the wrapped implementation does not return any matches. For example, Rule alpha; ... WithDefaultsRulesWrapper rules = new WithDefaultsRulesWrapper(new BaseRules()); rules.addDefault(alpha); ... digester.setRules(rules); ... when a pattern does not match any other rule, then rule alpha will be called. WithDefaultsRulesWrapper follows the Decorator ...
Substitutor: (Logical) Interface for substitution strategies. (It happens to be implemented as a Java abstract class to allow future additions to be made without breaking backwards compatibility.) Usage: When Digester.setSubstitutor(org.apache.commons.digester.Substitutor) 55 is set, Digester calls the methods in this interface to create substitute values which will be passed into the Rule implementations. Of course, it is perfectly acceptable for implementations not to make substitutions and simply return the inputs. Different strategies are supported for attributes and body text.
ObjectCreationFactory: Interface for use with FactoryCreateRule . The rule calls createObject(org.xml.sax.Attributes) 55 to create an object to be pushed onto the Digester stack whenever it is matched. AbstractObjectCreationFactory is an abstract implementation suitable for creating anonymous ObjectCreationFactory implementations.
PluginContext: Provides data and services which should exist only once per digester. This class holds a number of useful items which should be shared by all plugin objects. Such data cannot be stored on the PluginRules or PluginManager classes, as there can be multiple instances of these at various times during a parse. The name "Context" refers to the similarity between this class and a ServletContext class in a servlet engine. A ServletContext object provides access to the container's services such as obtaining global configuration parameters for the container, or getting access to logging services. For plugins, ...
FinderSetProperties: A rule-finding algorithm which expects the user to specify whether "automatic property setting" is desired. If this class discovers that this is in fact the case for a declaration, then a RuleLoader is returned which, when invoked, adds a single SetPropertiesRule instance to the digester. This allows ordinary JavaBean classes to be used as plugins, and have xml attributes be mapped to bean properties of the same name, without any custom plugin rules being created for them. This RuleFinder is typically used as the last RuleFinder, so that automatic property setting only occurs if there is no other ...
SetPropertiesRule: Rule implementation that sets properties on the object at the top of the stack, based on attributes with corresponding names. This rule supports custom mapping of attribute names to property names. The default mapping for particular attributes can be overridden by using SetPropertiesRule(String[] attributeNames, String[] propertyNames) 55 . This allows attributes to be mapped to properties with different names. Certain attributes can also be marked to be ignored.
RSSDigester: Implementation of org.apache.commons.digester.Digester designed to process input streams that conform to the Rich Site Summary DTD, version 0.91. For more information about this format, see the My Netscape site. The default implementation object returned by calling parse() (an instance of org.apache.commons.digester.rss.Channel ) knows how to render itself in XML format via the render() method. See the test main() method below for an example of using these classes.
FactoryCreateRule: Rule implementation that uses an ObjectCreationFactory to create a new object which it pushes onto the object stack. When the element is complete, the object will be popped. This rule is intended in situations where the element's attributes are needed before the object can be created. A common senario is for the ObjectCreationFactory implementation to use the attributes as parameters in a call to either a factory method or to a non-empty constructor.
RuleLoader: Interface for classes which can dynamically load custom plugin rules associated with a user's plugin class. Each plugin declaration has an associated RuleLoader instance, and that instance's addRules method is invoked each time the input xml specifies that an instance of that plugged-in class is to be created. This is an abstract class rather than an interface in order to make it possible to enhance this class in future without breaking binary compatibility; it is possible to add methods to an abstract class, but not to an interface.
BeanPropertySetterRule: Rule implements sets a bean property on the top object to the body text. The property set: can be specified when the rule is created or can match the current element when the rule is called. Using the second method and the ExtendedBaseRules child match pattern, all the child elements can be automatically mapped to properties on the parent object.

Home | Contact Us | Privacy Policy | Terms of Service