org.apache.asn1.ber.digester
Interface Rules

All Known Implementing Classes:
RulesBase

public interface Rules

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. The interface has been inspired by the rulesBase equivalent.

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

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.
 

Method Detail

getDigester

public BERDigester getDigester()
Get the BERDigester instance with which this Rules instance is associated.

Returns:
the BERDigester associated with this Rules instance

setDigester

public void setDigester(BERDigester digester)
Get the BERDigester instance with which this Rules instance is associated.

Parameters:
digester - the new BERDigester to be associated with this Rules instance

add

public void add(int[] pattern,
                Rule rule)
Register a new Rule instance matching the specified pattern.

Parameters:
pattern - Tag nesting pattern to be matched for this Rule
rule - Rule instance to be registered

clear

public void clear()
Clear all existing Rule instance registrations.


match

public 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. If more than one Rule instance matches, they must be returned in the order originally registered through the add() method.

Parameters:
pattern - Nesting pattern to be matched

match

public 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. 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.

Parameters:
pattern - Nesting pattern to be matched

rules

public java.util.List 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.



Copyright © 2004-2006 . All Rights Reserved.