org.apache.asn1.ber.digester
Class RulesBase

java.lang.Object
  extended byorg.apache.asn1.ber.digester.RulesBase
All Implemented Interfaces:
Rules

public class RulesBase
extends java.lang.Object
implements Rules

A base Rules implementation using a fast pattern match.

Version:
$Rev: 157644 $
Author:
Apache Directory Project

Field Summary
private  BERDigester digester
           
private  java.util.ArrayList rules
           
private  TagTree tagTree
           
 
Constructor Summary
RulesBase()
          Creates a base Rules instance.
 
Method Summary
 void add(int[] pattern, Rule rule)
          Register a new Rule instance matching the specified pattern.
 void clear()
          Clear all existing Rule instance registrations.
 BERDigester getDigester()
          Get the BERDigester instance with which this Rules instance is associated.
 java.util.List match(int[] pattern)
          Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if there are no matches.
 java.util.List match(org.apache.commons.collections.primitives.IntStack pattern)
          Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if there are no matches.
 java.util.List rules()
          Return a List of all registered Rule instances, or a zero-length List if there are no registered Rule instances.
 void setDigester(BERDigester digester)
          Get the BERDigester instance with which this Rules instance is associated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tagTree

private TagTree tagTree

rules

private java.util.ArrayList rules

digester

private BERDigester digester
Constructor Detail

RulesBase

public RulesBase()
Creates a base Rules instance.

Method Detail

setDigester

public void setDigester(BERDigester digester)
Description copied from interface: Rules
Get the BERDigester instance with which this Rules instance is associated.

Specified by:
setDigester in interface Rules
Parameters:
digester - the new BERDigester to be associated with this Rules instance

getDigester

public BERDigester getDigester()
Description copied from interface: Rules
Get the BERDigester instance with which this Rules instance is associated.

Specified by:
getDigester in interface Rules
Returns:
the BERDigester associated with this Rules instance

add

public void add(int[] pattern,
                Rule rule)
Description copied from interface: Rules
Register a new Rule instance matching the specified pattern.

Specified by:
add in interface Rules
Parameters:
pattern - Tag nesting pattern to be matched for this Rule
rule - Rule instance to be registered

clear

public void clear()
Description copied from interface: Rules
Clear all existing Rule instance registrations.

Specified by:
clear in interface Rules

match

public java.util.List match(int[] pattern)
Description copied from interface: Rules
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.

Specified by:
match in interface Rules
Parameters:
pattern - Nesting pattern to be matched

match

public java.util.List match(org.apache.commons.collections.primitives.IntStack pattern)
Description copied from interface: Rules
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. The IntStack argument should not be affected by the match call.

Specified by:
match in interface Rules
Parameters:
pattern - Nesting pattern to be matched

rules

public java.util.List rules()
Description copied from interface: Rules
Return a List of all registered Rule instances, or a zero-length List if there are no registered Rule instances. If more than one Rule instance has been registered, they must be returned in the order originally registered through the add() method.

Specified by:
rules in interface Rules


Copyright © 2004-2006 . All Rights Reserved.