You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/12/16 00:25:46 UTC
svn commit: r487713 [2/2] - in /directory/trunks:
apacheds/core/src/main/java/org/apache/directory/server/core/authz/
apacheds/core/src/main/java/org/apache/directory/server/core/event/
apacheds/core/src/main/java/org/apache/directory/server/core/jndi/...
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.java Fri Dec 15 15:25:43 2006
@@ -22,6 +22,7 @@
import java.util.ArrayList;
+import java.util.List;
import java.math.BigInteger;
@@ -35,43 +36,42 @@
public class BranchNode extends AbstractExprNode
{
/** logical operator for this branch node */
- private final int m_operator;
+ private final AssertionEnum operator;
/** child node list for this branch node */
- private ArrayList m_children = null;
+ private List<ExprNode> children = null;
/**
* Creates a BranchNode using a logical operator and a list of children.
*
- * @param an_operator
+ * @param operator
* the logical operator to use for this branch node.
* @param a_childList
* the child nodes under this branch node.
*/
- public BranchNode(int an_operator, ArrayList a_childList)
+ public BranchNode( AssertionEnum operator, List<ExprNode> childList)
{
- super( an_operator );
+ super( operator );
- if ( null == a_childList )
+ if ( null == childList )
{
- m_children = new ArrayList( 2 );
+ children = new ArrayList<ExprNode>( 2 );
}
else
{
- m_children = a_childList;
+ children = childList;
}
- m_operator = an_operator;
+ this.operator = operator;
- switch ( m_operator )
+ switch ( operator )
{
- case ( AND ):
- break;
- case ( NOT ):
- break;
- case ( OR ):
+ case AND :
+ case NOT :
+ case OR :
break;
+
default:
throw new IllegalArgumentException( "Logical operator argument in constructor is undefined." );
}
@@ -81,12 +81,12 @@
/**
* Creates a BranchNode using a logical operator.
*
- * @param an_operator
+ * @param operator
* the logical operator to use for this branch node.
*/
- public BranchNode(int an_operator)
+ public BranchNode( AssertionEnum operator)
{
- this( an_operator, null );
+ this( operator, null );
}
@@ -96,17 +96,17 @@
* add more than one node to a negation branch node will result in an
* IllegalStateException.
*
- * @param a_node
+ * @param node
* the child expression to add to this branch node
*/
- public void addNode( ExprNode a_node )
+ public void addNode( ExprNode node )
{
- if ( NOT == m_operator && m_children.size() >= 1 )
+ if ( ( AssertionEnum.NOT == operator ) && ( children.size() >= 1 ) )
{
throw new IllegalStateException( "Cannot add more than one element" + " to a negation node." );
}
- m_children.add( a_node );
+ children.add( node );
}
@@ -116,17 +116,17 @@
* more than one child. An attempt to add more than one node to a negation
* branch node will result in an IllegalStateException.
*
- * @param a_node
+ * @param node
* the child expression to add to this branch node
*/
- public void addNodeToHead( ExprNode a_node )
+ public void addNodeToHead( ExprNode node )
{
- if ( NOT == m_operator && m_children.size() >= 1 )
+ if ( ( AssertionEnum.NOT == operator ) && ( children.size() >= 1 ) )
{
throw new IllegalStateException( "Cannot add more than one element" + " to a negation node." );
}
- m_children.add( 0, a_node );
+ children.add( 0, node );
}
@@ -148,9 +148,9 @@
*
* @return the list of child nodes under this branch node.
*/
- public ArrayList getChildren()
+ public List<ExprNode> getChildren()
{
- return m_children;
+ return children;
}
@@ -163,9 +163,9 @@
*/
public ExprNode getChild()
{
- if ( m_children.size() > 0 )
+ if ( children.size() > 0 )
{
- return ( ExprNode ) m_children.get( 0 );
+ return children.get( 0 );
}
return null;
@@ -175,12 +175,12 @@
/**
* Sets the list of children under this node.
*
- * @param a_list
+ * @param list
* the list of children to set.
*/
- void setChildren( ArrayList a_list )
+ void setChildren( List<ExprNode> list )
{
- m_children = a_list;
+ children = list;
}
@@ -189,9 +189,9 @@
*
* @return the operator constant.
*/
- public int getOperator()
+ public AssertionEnum getOperator()
{
- return m_operator;
+ return operator;
}
@@ -202,7 +202,7 @@
*/
public boolean isDisjunction()
{
- return OR == m_operator;
+ return AssertionEnum.OR == operator;
}
@@ -213,7 +213,7 @@
*/
public boolean isConjunction()
{
- return AND == m_operator;
+ return AssertionEnum.AND == operator;
}
@@ -222,9 +222,9 @@
*
* @return true if the operation is a NOT, false otherwise.
*/
- public final boolean isNegation()
+ public boolean isNegation()
{
- return NOT == m_operator;
+ return AssertionEnum.NOT == operator;
}
@@ -234,43 +234,47 @@
*
* @see org.apache.directory.shared.ldap.filter.ExprNode#printToBuffer(java.lang.StringBuffer)
*/
- public StringBuffer printToBuffer( StringBuffer a_buf )
+ public StringBuffer printToBuffer( StringBuffer buf )
{
- a_buf.append( '(' );
+ buf.append( '(' );
- switch ( m_operator )
+ switch ( operator )
{
- case ( AND ):
- a_buf.append( "& " );
+ case AND :
+ buf.append( "& " );
break;
- case ( NOT ):
- a_buf.append( "! " );
+
+ case NOT :
+ buf.append( "! " );
break;
- case ( OR ):
- a_buf.append( "| " );
+
+ case OR :
+ buf.append( "| " );
break;
+
default:
- a_buf.append( "UNKNOWN" );
+ buf.append( "UNKNOWN" );
}
- for ( int ii = 0; ii < m_children.size(); ii++ )
+ for ( ExprNode node:children )
{
- ( ( ExprNode ) m_children.get( ii ) ).printToBuffer( a_buf );
+ node.printToBuffer( buf );
}
-
- a_buf.append( ')' );
- if ( null != getAnnotations() && getAnnotations().containsKey( "count" ) )
+
+ buf.append( ')' );
+
+ if ( ( null != getAnnotations() ) && getAnnotations().containsKey( "count" ) )
{
- a_buf.append( '[' );
- a_buf.append( ( ( BigInteger ) getAnnotations().get( "count" ) ).toString() );
- a_buf.append( "] " );
+ buf.append( '[' );
+ buf.append( ( ( BigInteger ) getAnnotations().get( "count" ) ).toString() );
+ buf.append( "] " );
}
else
{
- a_buf.append( ' ' );
+ buf.append( ' ' );
}
- return a_buf;
+ return buf;
}
@@ -282,26 +286,29 @@
* the operator constant.
* @return one of the strings AND, OR, or NOT.
*/
- public static String getOperatorString( int a_operator )
+ public static String getOperatorString( AssertionEnum operator )
{
- String l_opstr = null;
+ String opstr = null;
- switch ( a_operator )
+ switch ( operator )
{
- case ( AND ):
- l_opstr = "AND";
+ case AND :
+ opstr = "AND";
break;
- case ( NOT ):
- l_opstr = "NOT";
+
+ case NOT :
+ opstr = "NOT";
break;
- case ( OR ):
- l_opstr = "OR";
+
+ case OR :
+ opstr = "OR";
break;
+
default:
- l_opstr = "UNKNOWN";
+ opstr = "UNKNOWN";
}
- return l_opstr;
+ return opstr;
}
@@ -313,20 +320,21 @@
*/
public String toString()
{
- StringBuffer l_buf = new StringBuffer();
- l_buf.append( getOperatorString( m_operator ) );
- if ( null != getAnnotations() && getAnnotations().containsKey( "count" ) )
- {
- l_buf.append( '[' );
- l_buf.append( ( ( BigInteger ) getAnnotations().get( "count" ) ).toString() );
- l_buf.append( "] " );
+ StringBuffer buf = new StringBuffer();
+ buf.append( getOperatorString( operator ) );
+
+ if ( ( null != getAnnotations() ) && getAnnotations().containsKey( "count" ) )
+ {
+ buf.append( '[' );
+ buf.append( ( ( BigInteger ) getAnnotations().get( "count" ) ).toString() );
+ buf.append( "] " );
}
else
{
- l_buf.append( ' ' );
+ buf.append( ' ' );
}
- return l_buf.toString();
+ return buf.toString();
}
@@ -338,26 +346,25 @@
{
if ( visitor.isPrefix() )
{
- ArrayList children = visitor.getOrder( this, m_children );
+ List<ExprNode> children = visitor.getOrder( this, this.children );
if ( visitor.canVisit( this ) )
{
visitor.visit( this );
}
- for ( int ii = 0; ii < children.size(); ii++ )
+ for ( ExprNode node:children )
{
- ( ( ExprNode ) children.get( ii ) ).accept( visitor );
+ node.accept( visitor );
}
}
else
{
- ArrayList children = visitor.getOrder( this, m_children );
+ List<ExprNode> children = visitor.getOrder( this, this.children );
- for ( int ii = 0; ii < children.size(); ii++ )
+ for ( ExprNode node:children )
{
- ExprNode child = ( ExprNode ) children.get( ii );
- child.accept( visitor );
+ node.accept( visitor );
}
if ( visitor.canVisit( this ) )
@@ -397,18 +404,19 @@
BranchNode otherExprNode = ( BranchNode ) other;
- ArrayList otherChildren = otherExprNode.getChildren();
+ List<ExprNode> otherChildren = otherExprNode.getChildren();
- if ( otherExprNode.getOperator() != m_operator )
+ if ( otherExprNode.getOperator() != operator )
{
return false;
}
- if ( otherChildren == m_children )
+ if ( otherChildren == children )
{
return true;
}
- return ( null != m_children && null != otherChildren ) && m_children.equals( otherChildren );
+ return ( ( null != children ) && ( null != otherChildren ) &&
+ children.equals( otherChildren ) );
}
}
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNormalizedVisitor.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNormalizedVisitor.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNormalizedVisitor.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNormalizedVisitor.java Fri Dec 15 15:25:43 2006
@@ -20,6 +20,7 @@
package org.apache.directory.shared.ldap.filter;
+import java.util.List;
import java.util.TreeSet;
import java.util.ArrayList;
import java.util.Comparator;
@@ -52,7 +53,7 @@
BranchNode branch = ( BranchNode ) node;
- if ( branch.getOperator() == AbstractExprNode.NOT )
+ if ( branch.getOperator() == AssertionEnum.NOT )
{
return;
}
@@ -61,7 +62,7 @@
TreeSet set = new TreeSet( nodeComparator );
- ArrayList children = branch.getChildren();
+ List<ExprNode> children = branch.getChildren();
for ( int ii = 0; ii < children.size(); ii++ )
{
@@ -98,7 +99,7 @@
}
- public ArrayList getOrder( BranchNode node, ArrayList children )
+ public List<ExprNode> getOrder( BranchNode node, List<ExprNode> children )
{
return children;
}
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExprNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExprNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExprNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExprNode.java Fri Dec 15 15:25:43 2006
@@ -43,12 +43,12 @@
/**
* Sets a annotation key to a value.
*
- * @param a_key
+ * @param key
* the annotation key.
- * @param a_value
+ * @param value
* the annotation value.
*/
- void set( Object a_key, Object a_value );
+ void set( String key, Object value );
/**
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExtensibleNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExtensibleNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExtensibleNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExtensibleNode.java Fri Dec 15 15:25:43 2006
@@ -73,7 +73,7 @@
*/
public ExtensibleNode(String attribute, byte[] value, String matchingRuleId, boolean dnAttributes)
{
- super( attribute, EXTENSIBLE );
+ super( attribute, AssertionEnum.EXTENSIBLE );
this.value = value;
this.matchingRuleId = matchingRuleId;
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterVisitor.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterVisitor.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterVisitor.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterVisitor.java Fri Dec 15 15:25:43 2006
@@ -20,7 +20,7 @@
package org.apache.directory.shared.ldap.filter;
-import java.util.ArrayList;
+import java.util.List;
/**
@@ -48,20 +48,20 @@
/**
* Visits a filter expression AST using a specific visitation order.
*
- * @param a_node
+ * @param node
* the node to visit
*/
- void visit( ExprNode a_node );
+ void visit( ExprNode node );
/**
* Checks to see if a node can be visited.
*
- * @param a_node
+ * @param node
* the node to be visited
* @return whether or node the node should be visited
*/
- boolean canVisit( ExprNode a_node );
+ boolean canVisit( ExprNode node );
/**
@@ -83,5 +83,5 @@
* the child node array
* @return the new reordered array of children
*/
- ArrayList getOrder( BranchNode node, ArrayList a_children );
+ List<ExprNode> getOrder( BranchNode node, List<ExprNode> children );
}
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LeafNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LeafNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LeafNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LeafNode.java Fri Dec 15 15:25:43 2006
@@ -38,7 +38,7 @@
* @param attribute the attribute this node is based on
* @param type the type of this leaf node
*/
- protected LeafNode( String attribute, int type )
+ protected LeafNode( String attribute, AssertionEnum type )
{
super( type );
this.attribute = attribute;
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/PresenceNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/PresenceNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/PresenceNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/PresenceNode.java Fri Dec 15 15:25:43 2006
@@ -32,36 +32,36 @@
/**
* Creates a PresenceNode object based on an attribute.
*
- * @param an_attribute
+ * @param attribute
* the attribute to assert the presence of
*/
- public PresenceNode(String an_attribute)
+ public PresenceNode( String attribute )
{
- super( an_attribute, PRESENCE );
+ super( attribute, AssertionEnum.PRESENCE );
}
/**
* @see org.apache.directory.shared.ldap.filter.ExprNode#printToBuffer(java.lang.StringBuffer)
*/
- public StringBuffer printToBuffer( StringBuffer a_buf )
+ public StringBuffer printToBuffer( StringBuffer buf )
{
- a_buf.append( '(' ).append( getAttribute() ).append( "=*" );
+ buf.append( '(' ).append( getAttribute() ).append( "=*" );
- a_buf.append( ')' );
+ buf.append( ')' );
if ( ( null != getAnnotations() ) && getAnnotations().containsKey( "count" ) )
{
- a_buf.append( '[' );
- a_buf.append( getAnnotations().get( "count" ).toString() );
- a_buf.append( "] " );
+ buf.append( '[' );
+ buf.append( getAnnotations().get( "count" ).toString() );
+ buf.append( "] " );
}
else
{
- a_buf.append( ' ' );
+ buf.append( ' ' );
}
- return a_buf;
+ return buf;
}
@@ -70,9 +70,10 @@
*/
public String toString()
{
- StringBuffer l_buf = new StringBuffer();
- printToBuffer( l_buf );
- return ( l_buf.toString() );
+ StringBuffer buf = new StringBuffer();
+ printToBuffer( buf );
+
+ return ( buf.toString() );
}
@@ -80,11 +81,11 @@
* @see org.apache.directory.shared.ldap.filter.ExprNode#accept(
* org.apache.directory.shared.ldap.filter.FilterVisitor)
*/
- public void accept( FilterVisitor a_visitor )
+ public void accept( FilterVisitor visitor )
{
- if ( a_visitor.canVisit( this ) )
+ if ( visitor.canVisit( this ) )
{
- a_visitor.visit( this );
+ visitor.visit( this );
}
}
}
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java Fri Dec 15 15:25:43 2006
@@ -58,7 +58,7 @@
*/
public ScopeNode(DerefAliasesEnum derefAliases, String baseDn, int scope)
{
- super( SCOPE );
+ super( AssertionEnum.SCOPE );
this.scope = scope;
this.baseDn = baseDn;
this.derefAliases = derefAliases;
@@ -76,9 +76,9 @@
* @param scope
* the search scope
*/
- public ScopeNode(Map env, String baseDn, int scope)
+ public ScopeNode( Map<String, DerefAliasesEnum> env, String baseDn, int scope )
{
- super( SCOPE );
+ super( AssertionEnum.SCOPE );
this.scope = scope;
this.baseDn = baseDn;
this.derefAliases = DerefAliasesEnum.getEnum( env );
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java Fri Dec 15 15:25:43 2006
@@ -42,7 +42,7 @@
* @param type
* the type of the assertion
*/
- public SimpleNode( String attribute, byte[] value, int type )
+ public SimpleNode( String attribute, byte[] value, AssertionEnum type )
{
// this( attribute, StringTools.utf8ToString( value ), type );
super( attribute, type );
@@ -50,27 +50,21 @@
switch ( type )
{
- case ( APPROXIMATE ):
+ case APPROXIMATE :
+ case EQUALITY :
+ case GREATEREQ :
+ case LESSEQ :
break;
- case ( EQUALITY ):
- break;
-
- case ( EXTENSIBLE ):
+ case EXTENSIBLE :
throw new IllegalArgumentException( "Assertion type supplied is "
+ "extensible. Use ExtensibleNode instead." );
- case ( GREATEREQ ):
- break;
-
- case ( LESSEQ ):
- break;
-
- case ( PRESENCE ):
+ case PRESENCE :
throw new IllegalArgumentException( "Assertion type supplied is "
+ "presence. Use PresenceNode instead." );
- case ( SUBSTRING ):
+ case SUBSTRING :
throw new IllegalArgumentException( "Assertion type supplied is "
+ "substring. Use SubstringNode instead." );
@@ -90,34 +84,28 @@
* @param type
* the type of the assertion
*/
- public SimpleNode( String attribute, String value, int type )
+ public SimpleNode( String attribute, String value, AssertionEnum type )
{
super( attribute, type );
this.value = value;
switch ( type )
{
- case ( APPROXIMATE ):
+ case APPROXIMATE :
+ case EQUALITY :
+ case GREATEREQ :
+ case LESSEQ :
break;
- case ( EQUALITY ):
- break;
-
- case ( EXTENSIBLE ):
+ case EXTENSIBLE :
throw new IllegalArgumentException( "Assertion type supplied is "
+ "extensible. Use ExtensibleNode instead." );
- case ( GREATEREQ ):
- break;
-
- case ( LESSEQ ):
- break;
-
- case ( PRESENCE ):
+ case PRESENCE :
throw new IllegalArgumentException( "Assertion type supplied is "
+ "presence. Use PresenceNode instead." );
- case ( SUBSTRING ):
+ case SUBSTRING :
throw new IllegalArgumentException( "Assertion type supplied is "
+ "substring. Use SubstringNode instead." );
@@ -159,19 +147,19 @@
switch ( getAssertionType() )
{
- case ( APPROXIMATE ):
+ case APPROXIMATE :
buf.append( "~=" );
break;
- case ( EQUALITY ):
+ case EQUALITY :
buf.append( "=" );
break;
- case ( GREATEREQ ):
+ case GREATEREQ :
buf.append( ">=" );
break;
- case ( LESSEQ ):
+ case LESSEQ :
buf.append( "<=" );
break;
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java Fri Dec 15 15:25:43 2006
@@ -65,7 +65,7 @@
*/
public SubstringNode(String attribute, String initialPattern, String finalPattern)
{
- super( attribute, SUBSTRING );
+ super( attribute, AssertionEnum.SUBSTRING );
anyPattern = new ArrayList( 2 );
this.finalPattern = finalPattern;
@@ -88,7 +88,7 @@
*/
public SubstringNode( List<String> anyPattern, String attribute, String initialPattern, String finalPattern )
{
- super( attribute, SUBSTRING );
+ super( attribute, AssertionEnum.SUBSTRING );
this.anyPattern = anyPattern;
this.finalPattern = finalPattern;
Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java (original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java Fri Dec 15 15:25:43 2006
@@ -63,7 +63,7 @@
SimpleNode node = ( SimpleNode ) parser.parse( "( ou ~= people )" );
assertEquals( "ou", node.getAttribute() );
assertEquals( "people", node.getValue() );
- assertEquals( AbstractExprNode.APPROXIMATE, node.getAssertionType() );
+ assertEquals( AssertionEnum.APPROXIMATE, node.getAssertionType() );
}
@@ -71,7 +71,7 @@
{
BranchNode node = ( BranchNode ) parser.parse( "(& ( ou ~= people ) (age>=30) ) " );
assertEquals( 2, node.getChildren().size() );
- assertEquals( AbstractExprNode.AND, node.getOperator() );
+ assertEquals( AssertionEnum.AND, node.getOperator() );
}
@@ -79,7 +79,7 @@
{
BranchNode node = ( BranchNode ) parser.parse( "(| ( ou ~= people ) (age>=30) ) " );
assertEquals( 2, node.getChildren().size() );
- assertEquals( AbstractExprNode.OR, node.getOperator() );
+ assertEquals( AssertionEnum.OR, node.getOperator() );
}
@@ -87,7 +87,7 @@
{
BranchNode node = ( BranchNode ) parser.parse( "( ! (& ( ou ~= people ) (age>=30) ) )" );
assertEquals( 1, node.getChildren().size() );
- assertEquals( AbstractExprNode.NOT, node.getOperator() );
+ assertEquals( AssertionEnum.NOT, node.getOperator() );
}
@@ -119,27 +119,27 @@
{
PresenceNode node = ( PresenceNode ) parser.parse( "( ou =*)" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
node = ( PresenceNode ) parser.parse( "( ou =* )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
node = ( PresenceNode ) parser.parse( "( ou = * )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
node = ( PresenceNode ) parser.parse( "( ou = *)" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
node = ( PresenceNode ) parser.parse( "( ou =* ) " );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
node = ( PresenceNode ) parser.parse( "( ou =*)" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
}
@@ -147,23 +147,23 @@
{
PresenceNode node = ( PresenceNode ) parser.parse( "( 1.2.3.4 = * )" );
assertEquals( "1.2.3.4", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
node = ( PresenceNode ) parser.parse( "( 1.2.3.4 = * )" );
assertEquals( "1.2.3.4", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
node = ( PresenceNode ) parser.parse( "( 1.2.3.4 = *)" );
assertEquals( "1.2.3.4", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
node = ( PresenceNode ) parser.parse( "( 1.2.3.4 =* ) " );
assertEquals( "1.2.3.4", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
node = ( PresenceNode ) parser.parse( "( 1.2.3.4 =*)" );
assertEquals( "1.2.3.4", node.getAttribute() );
- assertEquals( AbstractExprNode.PRESENCE, node.getAssertionType() );
+ assertEquals( AssertionEnum.PRESENCE, node.getAssertionType() );
}
@@ -172,7 +172,7 @@
SimpleNode node = ( SimpleNode ) parser.parse( "( ou = people )" );
assertEquals( "ou", node.getAttribute() );
assertEquals( "people", node.getValue() );
- assertEquals( AbstractExprNode.EQUALITY, node.getAssertionType() );
+ assertEquals( AssertionEnum.EQUALITY, node.getAssertionType() );
}
@@ -181,7 +181,7 @@
SimpleNode node = ( SimpleNode ) parser.parse( "( ou = people/in/my/company )" );
assertEquals( "ou", node.getAttribute() );
assertEquals( "people/in/my/company", node.getValue() );
- assertEquals( AbstractExprNode.EQUALITY, node.getAssertionType() );
+ assertEquals( AssertionEnum.EQUALITY, node.getAssertionType() );
}
@@ -192,7 +192,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( "stupidMatch", node.getMatchingRuleId() );
assertTrue( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -204,7 +204,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
assertTrue( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -215,7 +215,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( "stupidMatch", node.getMatchingRuleId() );
assertFalse( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -242,7 +242,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( null, node.getMatchingRuleId() );
assertFalse( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -253,7 +253,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
assertFalse( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -264,7 +264,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( "stupidMatch", node.getMatchingRuleId() );
assertTrue( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -291,7 +291,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
assertTrue( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -302,7 +302,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( "stupidMatch", node.getMatchingRuleId() );
assertFalse( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -313,7 +313,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
assertFalse( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -324,7 +324,7 @@
assertEquals( "dummyAssertion", StringTools.utf8ToString( node.getValue() ) );
assertEquals( null, node.getMatchingRuleId() );
assertFalse( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -335,7 +335,7 @@
assertEquals( "dummyAssertion\\23\\ac", StringTools.utf8ToString( node.getValue() ) );
assertEquals( null, node.getMatchingRuleId() );
assertFalse( node.dnAttributes() );
- assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
+ assertEquals( AssertionEnum.EXTENSIBLE, node.getAssertionType() );
}
@@ -424,7 +424,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou = foo* )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 0, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -437,7 +437,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou = foo*bar )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 0, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -450,7 +450,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou = *bar )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 0, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -463,7 +463,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou = foo*guy*bar )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 1, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -477,7 +477,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou =a*b*c*d*e*f )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 4, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -494,7 +494,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou =*b*c*d*e*f )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 4, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -511,7 +511,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou =a*b*c*d*e* )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 4, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -528,7 +528,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou =*b*c*d*e* )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 4, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -545,7 +545,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou = foo* *bar )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 0, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -559,7 +559,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou = foo* a *bar )" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 1, node.getAny().size() );
assertFalse( node.getAny().contains( "" ) );
@@ -578,7 +578,7 @@
{
SubstringNode node = ( SubstringNode ) parser.parse( "( ou =*foo*)" );
assertEquals( "ou", node.getAttribute() );
- assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() );
+ assertEquals( AssertionEnum.SUBSTRING, node.getAssertionType() );
assertEquals( 1, node.getAny().size() );
assertTrue( node.getAny().contains( "foo" ) );
Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java (original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java Fri Dec 15 15:25:43 2006
@@ -28,6 +28,7 @@
import junit.framework.TestCase;
import org.apache.directory.shared.ldap.filter.AbstractExprNode;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
import org.apache.directory.shared.ldap.filter.BranchNode;
import org.apache.directory.shared.ldap.filter.SimpleNode;
import org.apache.directory.shared.ldap.name.LdapDN;
@@ -267,19 +268,19 @@
{
SubtreeSpecification ss = parser.parse( SPEC_WITH_REFINEMENT );
- SimpleNode n1 = new SimpleNode( "objectClass", "1.2.3", 0 );
- SimpleNode n2 = new SimpleNode( "objectClass", "4.5.6", 0 );
- SimpleNode n3 = new SimpleNode( "objectClass", "person-7", 0 );
- BranchNode n4 = new BranchNode( AbstractExprNode.OR );
+ SimpleNode n1 = new SimpleNode( "objectClass", "1.2.3", AssertionEnum.EQUALITY );
+ SimpleNode n2 = new SimpleNode( "objectClass", "4.5.6", AssertionEnum.EQUALITY );
+ SimpleNode n3 = new SimpleNode( "objectClass", "person-7", AssertionEnum.EQUALITY );
+ BranchNode n4 = new BranchNode( AssertionEnum.OR );
n4.addNode( n2 );
n4.addNode( n3 );
- BranchNode n5 = new BranchNode( AbstractExprNode.AND );
+ BranchNode n5 = new BranchNode( AssertionEnum.AND );
n5.addNode( n1 );
n5.addNode( n4 );
- SimpleNode n6 = new SimpleNode( "objectClass", "10.11.12", 0 );
- BranchNode n7 = new BranchNode( AbstractExprNode.NOT );
+ SimpleNode n6 = new SimpleNode( "objectClass", "10.11.12", AssertionEnum.EQUALITY );
+ BranchNode n7 = new BranchNode( AssertionEnum.NOT );
n7.addNode( n6 );
- BranchNode n8 = new BranchNode( AbstractExprNode.AND );
+ BranchNode n8 = new BranchNode( AssertionEnum.AND );
n8.addNode( n5 );
n8.addNode( n7 );