Public interface defining a collection of Rule instances (and corresponding matching patterns) plus an implementation of a matching policy that selects the rules that match a particular pattern of nested elements discovered during parsing.
| 29 | * parsing. |
| 30 | */ |
| 31 | public interface Rules |
| 32 | { |
| 33 | |
| 34 | // ------------------------------------------------------------- Properties |
| 35 | |
| 36 | /** |
| 37 | * Return the Digester instance with which this Rules instance is associated. |
| 38 | * |
| 39 | * @return the Digester instance with which this Rules instance is associated |
| 40 | */ |
| 41 | Digester getDigester(); |
| 42 | |
| 43 | /** |
| 44 | * Set the Digester instance with which this Rules instance is associated. |
| 45 | * |
| 46 | * @param digester The newly associated Digester instance |
| 47 | */ |
| 48 | void setDigester( Digester digester ); |
| 49 | |
| 50 | /** |
| 51 | * Return the namespace URI that will be applied to all subsequently added <code>Rule</code> objects. |
| 52 | * |
| 53 | * @return the namespace URI that will be applied to all subsequently added <code>Rule</code> objects. |
| 54 | */ |
| 55 | String getNamespaceURI(); |
| 56 | |
| 57 | /** |
| 58 | * Set the namespace URI that will be applied to all subsequently added <code>Rule</code> objects. |
| 59 | * |
| 60 | * @param namespaceURI Namespace URI that must match on all subsequently added rules, or <code>null</code> for |
| 61 | * matching regardless of the current namespace URI |
| 62 | */ |
| 63 | void setNamespaceURI( String namespaceURI ); |
| 64 | |
| 65 | // --------------------------------------------------------- Public Methods |
| 66 | |
| 67 | /** |
| 68 | * Register a new Rule instance matching the specified pattern. |
| 69 | * |
| 70 | * @param pattern Nesting pattern to be matched for this Rule |
| 71 | * @param rule Rule instance to be registered |
| 72 | */ |
| 73 | void add( String pattern, Rule rule ); |
| 74 | |
| 75 | /** |
| 76 | * Clear all existing Rule instance registrations. |
| 77 | */ |
| 78 | void clear(); |
| 79 | |
| 80 | /** |
| 81 | * Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if |
| 82 | * there are no matches. If more than one Rule instance matches, they <strong>must</strong> be returned in the order |
| 83 | * originally registered through the <code>add()</code> method. |
| 84 | * |
| 85 | * @param namespaceURI Namespace URI for which to select matching rules, or <code>null</code> to match regardless of |
| 86 | * namespace URI |
| 87 | * @param pattern Nesting pattern to be matched |
| 88 | * @param name the local name if the parser is namespace aware, or just the element name otherwise |
no outgoing calls
no test coverage detected
searching dependent graphs…