org.apache.cocoon.util
Class ElementAttributeMatching

java.lang.Object
  extended byorg.apache.cocoon.util.ElementAttributeMatching

public class ElementAttributeMatching
extends Object

A helper class for matching element names, and attribute names.

For given include-name, exclude-name decide if element-attribute pair matches. This class defines the precedence and matching algorithm.

This was originally part of the EncodeURLTransformer, moved here to make it more reusable.

Version:
CVS $Id: ElementAttributeMatching.java 292282 2005-09-28 19:54:16Z vgritsenko $
Author:
Bernhard Huber

Field Summary
protected  org.apache.regexp.RE excludeNameRE
          Regular expression of excluding patterns
protected  org.apache.regexp.RE includeNameRE
          Regular expression of including patterns
 
Constructor Summary
ElementAttributeMatching(String includeName, String excludeName)
          Constructor for the ElementAttributeMatching object
 
Method Summary
 boolean matchesElementAttribute(String element_name, String attr_name, String value)
          Return true iff element_name attr_name pair is not matched by exclude-name, but is matched by include-name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

includeNameRE

protected org.apache.regexp.RE includeNameRE
Regular expression of including patterns


excludeNameRE

protected org.apache.regexp.RE excludeNameRE
Regular expression of excluding patterns

Constructor Detail

ElementAttributeMatching

public ElementAttributeMatching(String includeName,
                                String excludeName)
                         throws org.apache.regexp.RESyntaxException
Constructor for the ElementAttributeMatching object

Parameters:
includeName - Description of Parameter
excludeName - Description of Parameter
Throws:
org.apache.regexp.RESyntaxException - Description of Exception
Method Detail

matchesElementAttribute

public boolean matchesElementAttribute(String element_name,
                                       String attr_name,
                                       String value)
Return true iff element_name attr_name pair is not matched by exclude-name, but is matched by include-name

Parameters:
element_name -
attr_name -
value - used to canonicalize the elemtn/attribute name
Returns:
boolean true iff value of attribute_name should get rewritten, else false.


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.