Java Doc for PluginRules.java in  » Library » Apache-commons-digester-1.8-src » org » apache » commons » digester » plugins » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache commons digester 1.8 src » org.apache.commons.digester.plugins 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.digester.plugins.PluginRules

PluginRules
public class PluginRules implements Rules(Code)
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 instance is created and inserted at the head of the list (ie pushed onto the stack of Rules objects). Digester.getRules() therefore returns this new Rules object, and any custom rules associated with that plugin are added to that instance.

When the end of the xml element is encountered (and therefore the PluginCreateRule end method fires), the stack of Rules objects is popped, so that Digester.getRules returns the previous Rules object.
since:
   1.6



Field Summary
protected  Digesterdigester
     The Digester instance with which this Rules instance is associated.

Constructor Summary
public  PluginRules()
     Constructor for top-level Rules objects.
public  PluginRules(Rules decoratedRules)
     Constructor for top-level Rules object which handles rule-matching using the specified implementation.
 PluginRules(Digester digester, String mountPoint, PluginRules parent, Class pluginClass)
     Constructs a Rules instance which has a parent Rules object (which is different from having a delegate rules object).

Method Summary
public  voidadd(String pattern, Rule rule)
     Register a new Rule instance matching the specified pattern.
public  voidclear()
     Clear all rules.
 RulesgetDecoratedRules()
     This package-scope method is used by the PluginCreateRule class to get direct access to the rules that were dynamically added by the plugin.
public  DigestergetDigester()
     Return the Digester instance with which this instance is associated.
public  StringgetNamespaceURI()
     Return the namespace URI that will be applied to all subsequently added Rule objects.
public  RulesgetParent()
     Return the parent Rules object.
public  StringgetPluginClassAttr()
     See PluginContext.getPluginClassAttr .
public  StringgetPluginClassAttrNs()
     See PluginContext.getPluginClassAttrNs .
public  StringgetPluginIdAttr()
     See PluginContext.getPluginIdAttr .
public  StringgetPluginIdAttrNs()
     See PluginContext.getPluginIdAttrNs .
public  PluginManagergetPluginManager()
     Return the object which "knows" about all declared plugins.
public  ListgetRuleFinders()
     See PluginContext.getRuleFinders .
public  RulesFactorygetRulesFactory()
     Return the rules factory object (or null if one has not been specified).
public  Listmatch(String path)
     Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if there are no matches.
public  Listmatch(String namespaceURI, String path)
     Return a List of all registered Rule instances that match the specified nodepath, or a zero-length List if there are no matches.
public  Listrules()
     Return the list of rules registered with this object, in the order they were registered with this object.
public  voidsetDigester(Digester digester)
     Set the Digester instance with which this Rules instance is associated.
public  voidsetNamespaceURI(String namespaceURI)
     Set the namespace URI that will be applied to all subsequently added Rule objects.
public  voidsetPluginClassAttribute(String namespaceUri, String attrName)
     See PluginContext.setPluginClassAttribute .
public  voidsetPluginIdAttribute(String namespaceUri, String attrName)
     See PluginContext.setPluginIdAttribute .
public  voidsetRuleFinders(List ruleFinders)
     See PluginContext.setRuleFinders .
public  voidsetRulesFactory(RulesFactory factory)
     Set the object which is used to generate the new Rules instances created to hold and process the rules associated with each plugged-in class.

Field Detail
digester
protected Digester digester(Code)
The Digester instance with which this Rules instance is associated.




Constructor Detail
PluginRules
public PluginRules()(Code)
Constructor for top-level Rules objects. Exactly one of these must be created and installed into the Digester instance as the Rules object before parsing starts.



PluginRules
public PluginRules(Rules decoratedRules)(Code)
Constructor for top-level Rules object which handles rule-matching using the specified implementation.



PluginRules
PluginRules(Digester digester, String mountPoint, PluginRules parent, Class pluginClass) throws PluginException(Code)
Constructs a Rules instance which has a parent Rules object (which is different from having a delegate rules object).

One of these is created each time a PluginCreateRule's begin method fires, in order to manage the custom rules associated with whatever concrete plugin class the user has specified.
Parameters:
  digester - is the object this rules will be associated with.
Parameters:
  mountPoint - is the digester match path for the element matching a PluginCreateRule which caused this "nested parsing scope"to begin. This is expected to be equal to digester.getMatch().
Parameters:
  parent - must be non-null.
Parameters:
  pluginClass - is the plugin class whose custom rules will beloaded into this new PluginRules object.





Method Detail
add
public void add(String pattern, Rule rule)(Code)
Register a new Rule instance matching the specified pattern.
Parameters:
  pattern - Nesting pattern to be matched for this Rule.This parameter treats equally patterns that begin with and withouta leading slash ('/').
Parameters:
  rule - Rule instance to be registered



clear
public void clear()(Code)
Clear all rules.



getDecoratedRules
Rules getDecoratedRules()(Code)
This package-scope method is used by the PluginCreateRule class to get direct access to the rules that were dynamically added by the plugin. No other class should need access to this object.



getDigester
public Digester getDigester()(Code)
Return the Digester instance with which this instance is associated.



getNamespaceURI
public String getNamespaceURI()(Code)
Return the namespace URI that will be applied to all subsequently added Rule objects.



getParent
public Rules getParent()(Code)
Return the parent Rules object.



getPluginClassAttr
public String getPluginClassAttr()(Code)
See PluginContext.getPluginClassAttr .



getPluginClassAttrNs
public String getPluginClassAttrNs()(Code)
See PluginContext.getPluginClassAttrNs .



getPluginIdAttr
public String getPluginIdAttr()(Code)
See PluginContext.getPluginIdAttr .



getPluginIdAttrNs
public String getPluginIdAttrNs()(Code)
See PluginContext.getPluginIdAttrNs .



getPluginManager
public PluginManager getPluginManager()(Code)
Return the object which "knows" about all declared plugins. The pluginManager value



getRuleFinders
public List getRuleFinders()(Code)
See PluginContext.getRuleFinders .



getRulesFactory
public RulesFactory getRulesFactory()(Code)
Return the rules factory object (or null if one has not been specified).



match
public List match(String path)(Code)
Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if there are no matches. If more than one Rule instance matches, they must be returned in the order originally registered through the add() method.
Parameters:
  path - the path to the xml nodes to be matched.



match
public List match(String namespaceURI, String path)(Code)
Return a List of all registered Rule instances that match the specified nodepath, or a zero-length List if there are no matches. If more than one Rule instance matches, they must be returned in the order originally registered through the add() method.


Parameters:
  namespaceURI - Namespace URI for which to select matching rules,or null to match regardless of namespace URI
Parameters:
  path - the path to the xml nodes to be matched.




rules
public List rules()(Code)
Return the list of rules registered with this object, in the order they were registered with this object.

Note that Rule objects stored in parent Rules objects are not returned by this method. list of all Rule objects known to this Rules instance.




setDigester
public void setDigester(Digester digester)(Code)
Set the Digester instance with which this Rules instance is associated.
Parameters:
  digester - The newly associated Digester instance



setNamespaceURI
public void setNamespaceURI(String namespaceURI)(Code)
Set the namespace URI that will be applied to all subsequently added Rule objects.
Parameters:
  namespaceURI - Namespace URI that must match on allsubsequently added rules, or null for matchingregardless of the current namespace URI



setPluginClassAttribute
public void setPluginClassAttribute(String namespaceUri, String attrName)(Code)
See PluginContext.setPluginClassAttribute .



setPluginIdAttribute
public void setPluginIdAttribute(String namespaceUri, String attrName)(Code)
See PluginContext.setPluginIdAttribute .



setRuleFinders
public void setRuleFinders(List ruleFinders)(Code)
See PluginContext.setRuleFinders .



setRulesFactory
public void setRulesFactory(RulesFactory factory)(Code)
Set the object which is used to generate the new Rules instances created to hold and process the rules associated with each plugged-in class.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.