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 2007/12/15 21:39:15 UTC
svn commit: r604511 - in
/directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry:
ServerBinaryValueTest.java ServerStringValueTest.java
Author: elecharny
Date: Sat Dec 15 12:39:14 2007
New Revision: 604511
URL: http://svn.apache.org/viewvc?rev=604511&view=rev
Log:
o Completed the ServerStringValue tests
o Added a testCas for Binary values
Added:
directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
Modified:
directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java
Added: directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java?rev=604511&view=auto
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java (added)
+++ directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java Sat Dec 15 12:39:14 2007
@@ -0,0 +1,416 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.core.entry;
+
+
+import org.apache.directory.shared.ldap.schema.AbstractAttributeType;
+import org.apache.directory.shared.ldap.schema.AbstractMatchingRule;
+import org.apache.directory.shared.ldap.schema.AbstractSyntax;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.ByteArrayComparator;
+import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.Syntax;
+import org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker;
+import org.junit.Test;
+
+import javax.naming.NamingException;
+import javax.naming.directory.InvalidAttributeValueException;
+import java.util.Arrays;
+import java.util.Comparator;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
+
+
+/**
+ * Tests that the ServerBinaryValue class works properly as expected.
+ *
+ * Some notes while conducting tests:
+ *
+ * <ul>
+ * <li>comparing values with different types - how does this behave</li>
+ * <li>exposing access to at from value or to a comparator?</li>
+ * </ul>
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ServerBinaryValueTest
+{
+ /**
+ * A local Syntax class for tests
+ */
+ static class AT extends AbstractAttributeType
+ {
+ public static final long serialVersionUID = 0L;
+ AttributeType superior;
+ Syntax syntax;
+ MatchingRule equality;
+ MatchingRule ordering;
+ MatchingRule substr;
+
+ protected AT( String oid )
+ {
+ super( oid );
+ }
+
+ public AttributeType getSuperior() throws NamingException
+ {
+ return superior;
+ }
+
+
+ public Syntax getSyntax() throws NamingException
+ {
+ return syntax;
+ }
+
+
+ public MatchingRule getEquality() throws NamingException
+ {
+ return equality;
+ }
+
+
+ public MatchingRule getOrdering() throws NamingException
+ {
+ return ordering;
+ }
+
+
+ public MatchingRule getSubstr() throws NamingException
+ {
+ return substr;
+ }
+
+
+ public void setSuperior( AttributeType superior )
+ {
+ this.superior = superior;
+ }
+
+
+ public void setSyntax( Syntax syntax )
+ {
+ this.syntax = syntax;
+ }
+
+
+ public void setEquality( MatchingRule equality )
+ {
+ this.equality = equality;
+ }
+
+
+ public void setOrdering( MatchingRule ordering )
+ {
+ this.ordering = ordering;
+ }
+
+
+ public void setSubstr( MatchingRule substr )
+ {
+ this.substr = substr;
+ }
+ }
+
+ /**
+ * A local MatchingRule class for tests
+ */
+ static class MR extends AbstractMatchingRule
+ {
+ public static final long serialVersionUID = 0L;
+ private Syntax syntax;
+ private Comparator comparator;
+ private Normalizer normalizer;
+
+ protected MR( String oid )
+ {
+ super( oid );
+ }
+
+ public Syntax getSyntax() throws NamingException
+ {
+ return syntax;
+ }
+
+ public Comparator getComparator() throws NamingException
+ {
+ return comparator;
+ }
+
+
+ public Normalizer getNormalizer() throws NamingException
+ {
+ return normalizer;
+ }
+
+
+ public void setSyntax( Syntax syntax )
+ {
+ this.syntax = syntax;
+ }
+
+
+ public void setComparator( Comparator<?> comparator )
+ {
+ this.comparator = comparator;
+ }
+
+
+ public void setNormalizer( Normalizer normalizer )
+ {
+ this.normalizer = normalizer;
+ }
+ }
+
+
+ /**
+ * A local Syntax class used for the tests
+ */
+ static class S extends AbstractSyntax
+ {
+ public static final long serialVersionUID = 0L;
+ SyntaxChecker checker;
+
+ public S( String oid, boolean humanReadible )
+ {
+ super( oid, humanReadible );
+ }
+
+ public void setSyntaxChecker( SyntaxChecker checker )
+ {
+ this.checker = checker;
+ }
+
+ public SyntaxChecker getSyntaxChecker() throws NamingException
+ {
+ return checker;
+ }
+ }
+
+
+
+ private AttributeType getBytesAttributeType()
+ {
+ AT at = new AT( "1.1" );
+
+ S s = new S( "1.1.1", true );
+
+ s.setSyntaxChecker( new SyntaxChecker()
+ {
+ public String getSyntaxOid()
+ {
+ return "1.1.1";
+ }
+ public boolean isValidSyntax( Object value )
+ {
+ return ((byte[])value).length < 5 ;
+ }
+
+ public void assertSyntax( Object value ) throws NamingException
+ {
+ if ( ! isValidSyntax( value ) )
+ {
+ throw new InvalidAttributeValueException();
+ }
+ }
+ } );
+
+ final MR mr = new MR( "1.1.2" );
+ mr.syntax = s;
+ mr.comparator = new Comparator<byte[]>()
+ {
+ public int compare( byte[] o1, byte[] o2 )
+ {
+ return ( ( o1 == null ) ?
+ ( o2 == null ? 0 : -1 ) :
+ ( o2 == null ? 1 : ByteArrayComparator.INSTANCE.compare( o1, o2 ) ) );
+ }
+ };
+
+ mr.normalizer = new Normalizer()
+ {
+ public static final long serialVersionUID = 1L;
+
+ public Object normalize( Object value ) throws NamingException
+ {
+ if ( value instanceof byte[] )
+ {
+ byte[] val = (byte[])value;
+ // each byte will be changed to be > 0
+ byte[] newVal = new byte[ val.length ];
+ int i = 0;
+
+ for ( byte b:val )
+ {
+ newVal[i++] = (byte)(b & 0x007F);
+ }
+
+ return newVal;
+ }
+
+ throw new IllegalStateException( "expected byte[] to normalize" );
+ }
+ };
+
+ at.setEquality( mr );
+ at.setSyntax( s );
+ return at;
+ }
+
+
+ /**
+ * Test the constructor with bad AttributeType
+ */
+ @Test public void testBadConstructor()
+ {
+ try
+ {
+ new ServerBinaryValue( null );
+ fail();
+ }
+ catch ( AssertionError ae )
+ {
+ // Expected...
+ }
+
+ // create a AT without any syntax
+ AttributeType at = new AT( "1.1.3.1" );
+
+ try
+ {
+ new ServerBinaryValue( at );
+ fail();
+ }
+ catch ( AssertionError ae )
+ {
+ // Expected...
+ }
+ }
+
+
+ /**
+ * Test the constructor with a null value
+ */
+ @Test public void testNullValue()
+ {
+ AttributeType at = getBytesAttributeType();
+
+ ServerBinaryValue value = new ServerBinaryValue( at, null );
+
+ assertNull( value.getReference() );
+ assertTrue( value.isNull() );
+ }
+
+
+ /**
+ * Test the equals method
+ */
+ @Test public void testEquals()
+ {
+ AttributeType at = getBytesAttributeType();
+
+ ServerBinaryValue value1 = new ServerBinaryValue( at, new byte[]{0x01, (byte)0x02} );
+ ServerBinaryValue value2 = new ServerBinaryValue( at, new byte[]{0x01, (byte)0x02} );
+ ServerBinaryValue value3 = new ServerBinaryValue( at, new byte[]{0x01, (byte)0x82} );
+ ServerBinaryValue value4 = new ServerBinaryValue( at, new byte[]{0x01} );
+ ServerBinaryValue value5 = new ServerBinaryValue( at, null );
+
+ assertTrue( value1.equals( value1 ) );
+ assertTrue( value1.equals( value2 ) );
+ assertTrue( value1.equals( value3 ) );
+ assertFalse( value1.equals( value4 ) );
+ assertFalse( value1.equals( value5 ) );
+ assertFalse( value1.equals( "test" ) );
+ assertFalse( value1.equals( null ) );
+ }
+
+
+ /**
+ * Test the getNormalized method
+ * TODO testNormalized.
+ *
+ */
+ @Test public void testGetNormalized() throws NamingException
+ {
+ AttributeType at = getBytesAttributeType();
+
+ ServerBinaryValue value = new ServerBinaryValue( at, new byte[]{0x01, (byte)0x82} );
+
+ assertTrue( Arrays.equals( new byte[]{0x01, (byte)0x02}, value.getNormalizedReference() ) );
+ assertTrue( Arrays.equals( new byte[]{0x01, (byte)0x02}, value.getNormalizedCopy() ) );
+
+ value = new ServerBinaryValue( at, null );
+
+ assertNull( value.getNormalizedReference() );
+ }
+
+
+ /**
+ * Test the isValid method
+ *
+ * The SyntaxChecker does not accept values longer than 5 chars.
+ */
+ @Test public void testIsValid() throws NamingException
+ {
+ AttributeType at = getBytesAttributeType();
+
+ ServerBinaryValue value = new ServerBinaryValue( at, new byte[]{0x01, 0x02} );
+
+ assertTrue( value.isValid() );
+
+ value = new ServerBinaryValue( at, new byte[]{0x01, 0x02, 0x03, 0x04, 0x05, 0x06} );
+
+ assertFalse( value.isValid() );
+ }
+
+
+ /**
+ * Tests to make sure the hashCode method is working properly.
+ * @throws Exception on errors
+ */
+ @Test public void testHashCodeValidEquals() throws Exception
+ {
+ AttributeType at = getBytesAttributeType();
+ ServerBinaryValue v0 = new ServerBinaryValue( at, new byte[]{0x01, 0x02} );
+ ServerBinaryValue v1 = new ServerBinaryValue( at, new byte[]{(byte)0x81, (byte)0x82} );
+ ServerBinaryValue v2 = new ServerBinaryValue( at, new byte[]{0x01, 0x02} );
+ assertEquals( v0.hashCode(), v1.hashCode() );
+ assertEquals( v1.hashCode(), v2.hashCode() );
+ assertEquals( v0.hashCode(), v2.hashCode() );
+ assertEquals( v0, v1 );
+ assertEquals( v0, v2 );
+ assertEquals( v1, v2 );
+ assertTrue( v0.isValid() );
+ assertTrue( v1.isValid() );
+ assertTrue( v2.isValid() );
+
+ ServerBinaryValue v3 = new ServerBinaryValue( at, new byte[]{0x01, 0x03} );
+ assertFalse( v3.equals( v0 ) );
+ assertFalse( v3.equals( v1 ) );
+ assertFalse( v3.equals( v2 ) );
+ assertTrue( v3.isValid() );
+ }
+}
\ No newline at end of file
Modified: directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java?rev=604511&r1=604510&r2=604511&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java Sat Dec 15 12:39:14 2007
@@ -42,7 +42,9 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
/**
@@ -60,6 +62,158 @@
*/
public class ServerStringValueTest
{
+ /**
+ * A local Syntax class for tests
+ */
+ static class AT extends AbstractAttributeType
+ {
+ public static final long serialVersionUID = 0L;
+ AttributeType superior;
+ Syntax syntax;
+ MatchingRule equality;
+ MatchingRule ordering;
+ MatchingRule substr;
+
+ protected AT( String oid )
+ {
+ super( oid );
+ }
+
+ public AttributeType getSuperior() throws NamingException
+ {
+ return superior;
+ }
+
+
+ public Syntax getSyntax() throws NamingException
+ {
+ return syntax;
+ }
+
+
+ public MatchingRule getEquality() throws NamingException
+ {
+ return equality;
+ }
+
+
+ public MatchingRule getOrdering() throws NamingException
+ {
+ return ordering;
+ }
+
+
+ public MatchingRule getSubstr() throws NamingException
+ {
+ return substr;
+ }
+
+
+ public void setSuperior( AttributeType superior )
+ {
+ this.superior = superior;
+ }
+
+
+ public void setSyntax( Syntax syntax )
+ {
+ this.syntax = syntax;
+ }
+
+
+ public void setEquality( MatchingRule equality )
+ {
+ this.equality = equality;
+ }
+
+
+ public void setOrdering( MatchingRule ordering )
+ {
+ this.ordering = ordering;
+ }
+
+
+ public void setSubstr( MatchingRule substr )
+ {
+ this.substr = substr;
+ }
+ }
+
+ /**
+ * A local MatchingRule class for tests
+ */
+ static class MR extends AbstractMatchingRule
+ {
+ public static final long serialVersionUID = 0L;
+ private Syntax syntax;
+ private Comparator comparator;
+ private Normalizer normalizer;
+
+ protected MR( String oid )
+ {
+ super( oid );
+ }
+
+ public Syntax getSyntax() throws NamingException
+ {
+ return syntax;
+ }
+
+ public Comparator getComparator() throws NamingException
+ {
+ return comparator;
+ }
+
+
+ public Normalizer getNormalizer() throws NamingException
+ {
+ return normalizer;
+ }
+
+
+ public void setSyntax( Syntax syntax )
+ {
+ this.syntax = syntax;
+ }
+
+
+ public void setComparator( Comparator<?> comparator )
+ {
+ this.comparator = comparator;
+ }
+
+
+ public void setNormalizer( Normalizer normalizer )
+ {
+ this.normalizer = normalizer;
+ }
+ }
+
+
+ /**
+ * A local Syntax class used for the tests
+ */
+ static class S extends AbstractSyntax
+ {
+ public static final long serialVersionUID = 0L;
+ SyntaxChecker checker;
+
+ public S( String oid, boolean humanReadible )
+ {
+ super( oid, humanReadible );
+ }
+
+ public void setSyntaxChecker( SyntaxChecker checker )
+ {
+ this.checker = checker;
+ }
+
+ public SyntaxChecker getSyntaxChecker() throws NamingException
+ {
+ return checker;
+ }
+ }
+
private AttributeType getCaseIgnoringAttributeNoNumbersType()
{
S s = new S( "1.1.1.1", true );
@@ -78,6 +232,7 @@
}
String strval = ( String ) value;
+
for ( char c:strval.toCharArray() )
{
if ( Character.isDigit( c ) )
@@ -103,24 +258,9 @@
{
public int compare( String o1, String o2 )
{
- if ( o1 == null && o2 == null )
- {
- return 0;
- }
-
- //noinspection ConstantConditions
- if ( ( o1 == null ) && ( o2 != null ) )
- {
- return -1;
- }
-
- //noinspection ConstantConditions
- if ( ( o1 != null ) && ( o2 == null ) )
- {
- return 1;
- }
-
- return o1.compareTo( o2 );
+ return ( o1 == null ?
+ ( o2 == null ? 0 : -1 ) :
+ ( o2 == null ? 1 : o1.compareTo( o2 ) ) );
}
int getValue( String val )
@@ -144,6 +284,7 @@
mr.normalizer = new Normalizer()
{
+ public static final long serialVersionUID = 1L;
public Object normalize( Object value ) throws NamingException
{
@@ -155,6 +296,7 @@
throw new IllegalStateException( "expected string to normalize" );
}
};
+
AT at = new AT( "1.1.3.1" );
at.setEquality( mr );
at.setSyntax( s );
@@ -162,6 +304,170 @@
}
+ private AttributeType getIA5StringAttributeType()
+ {
+ AT at = new AT( "1.1" );
+
+ S s = new S( "1.1.1", true );
+
+ s.setSyntaxChecker( new SyntaxChecker()
+ {
+ public String getSyntaxOid()
+ {
+ return "1.1.1";
+ }
+ public boolean isValidSyntax( Object value )
+ {
+ return ((String)value).length() < 5 ;
+ }
+
+ public void assertSyntax( Object value ) throws NamingException
+ {
+ if ( ! isValidSyntax( value ) )
+ {
+ throw new InvalidAttributeValueException();
+ }
+ }
+ } );
+
+ final MR mr = new MR( "1.1.2" );
+ mr.syntax = s;
+ mr.comparator = new Comparator<String>()
+ {
+ public int compare( String o1, String o2 )
+ {
+ return ( ( o1 == null ) ?
+ ( o2 == null ? 0 : -1 ) :
+ ( o2 == null ? 1 : o1.compareTo( o2 ) ) );
+ }
+ };
+
+ mr.normalizer = new Normalizer()
+ {
+ public static final long serialVersionUID = 1L;
+
+ public Object normalize( Object value ) throws NamingException
+ {
+ if ( value instanceof String )
+ {
+ return ( ( String ) value ).toLowerCase();
+ }
+
+ throw new IllegalStateException( "expected string to normalize" );
+ }
+ };
+
+ at.setEquality( mr );
+ at.setSyntax( s );
+ return at;
+ }
+
+
+ /**
+ * Test the constructor with bad AttributeType
+ */
+ @Test public void testBadConstructor()
+ {
+ try
+ {
+ new ServerStringValue( null );
+ fail();
+ }
+ catch ( AssertionError ae )
+ {
+ // Expected...
+ }
+
+ // create a AT without any syntax
+ AttributeType at = new AT( "1.1.3.1" );
+
+ try
+ {
+ new ServerStringValue( at );
+ fail();
+ }
+ catch ( AssertionError ae )
+ {
+ // Expected...
+ }
+ }
+
+
+ /**
+ * Test the constructor with a null value
+ */
+ @Test public void testNullValue()
+ {
+ AttributeType at = getIA5StringAttributeType();
+
+ ServerStringValue value = new ServerStringValue( at, null );
+
+ assertNull( value.get() );
+ assertTrue( value.isNull() );
+ }
+
+
+ /**
+ * Test the equals method
+ */
+ @Test public void testEquals()
+ {
+ AttributeType at = getIA5StringAttributeType();
+
+ ServerStringValue value1 = new ServerStringValue( at, "test" );
+ ServerStringValue value2 = new ServerStringValue( at, "test" );
+ ServerStringValue value3 = new ServerStringValue( at, "TEST" );
+ ServerStringValue value4 = new ServerStringValue( at, "tes" );
+ ServerStringValue value5 = new ServerStringValue( at, null );
+
+ assertTrue( value1.equals( value1 ) );
+ assertTrue( value1.equals( value2 ) );
+ assertTrue( value1.equals( value3 ) );
+ assertFalse( value1.equals( value4 ) );
+ assertFalse( value1.equals( value5 ) );
+ assertFalse( value1.equals( "test" ) );
+ assertFalse( value1.equals( null ) );
+ }
+
+
+ /**
+ * Test the getNormalized method
+ * TODO testNormalized.
+ *
+ */
+ @Test public void testGetNormalized() throws NamingException
+ {
+ AttributeType at = getIA5StringAttributeType();
+
+ ServerStringValue value = new ServerStringValue( at, "TEST" );
+
+ assertEquals( "test", value.getNormalized() );
+
+ value = new ServerStringValue( at, null );
+
+ assertNull( value.getNormalized() );
+ }
+
+
+ /**
+ * Test the isValid method
+ *
+ * The SyntaxChecker does not accept values longer than 5 chars.
+ */
+ @Test public void testIsValid() throws NamingException
+ {
+ AttributeType at = getIA5StringAttributeType();
+
+ ServerStringValue value = new ServerStringValue( at, "test" );
+
+ assertTrue( value.isValid() );
+
+ value = new ServerStringValue( at, "testlong" );
+
+ assertFalse( value.isValid() );
+ }
+
+
/**
* Tests to make sure the hashCode method is working properly.
* @throws Exception on errors
@@ -225,19 +531,18 @@
{
public int compare( String o1, String o2 )
{
- if ( o1 == null && o2 == null )
+ if ( o1 == null )
{
- return 0;
- }
-
- //noinspection ConstantConditions
- if ( o1 == null && o2 != null )
- {
- return -1;
+ if ( o2 == null )
+ {
+ return 0;
+ }
+ else
+ {
+ return -1;
+ }
}
-
- //noinspection ConstantConditions
- if ( o1 != null && o2 == null )
+ else if ( o2 == null )
{
return 1;
}
@@ -320,7 +625,6 @@
list.add( v2 );
list.add( v4 );
- //noinspection unchecked
Collections.sort( list );
// null ones are at first 2 indices
@@ -440,7 +744,6 @@
try
{
- //noinspection unchecked
return mr.getComparator().compare( b1, b2 );
}
catch ( Exception e )
@@ -469,143 +772,4 @@
}
- static class AT extends AbstractAttributeType
- {
- AttributeType superior;
- Syntax syntax;
- MatchingRule equality;
- MatchingRule ordering;
- MatchingRule substr;
-
- protected AT( String oid )
- {
- super( oid );
- }
-
- public AttributeType getSuperior() throws NamingException
- {
- return superior;
- }
-
-
- public Syntax getSyntax() throws NamingException
- {
- return syntax;
- }
-
-
- public MatchingRule getEquality() throws NamingException
- {
- return equality;
- }
-
-
- public MatchingRule getOrdering() throws NamingException
- {
- return ordering;
- }
-
-
- public MatchingRule getSubstr() throws NamingException
- {
- return substr;
- }
-
-
- public void setSuperior( AttributeType superior )
- {
- this.superior = superior;
- }
-
-
- public void setSyntax( Syntax syntax )
- {
- this.syntax = syntax;
- }
-
-
- public void setEquality( MatchingRule equality )
- {
- this.equality = equality;
- }
-
-
- public void setOrdering( MatchingRule ordering )
- {
- this.ordering = ordering;
- }
-
-
- public void setSubstr( MatchingRule substr )
- {
- this.substr = substr;
- }
- }
-
- static class MR extends AbstractMatchingRule
- {
- private Syntax syntax;
- private Comparator comparator;
- private Normalizer normalizer;
-
- protected MR( String oid )
- {
- super( oid );
- }
-
- public Syntax getSyntax() throws NamingException
- {
- return syntax;
- }
-
- public Comparator getComparator() throws NamingException
- {
- return comparator;
- }
-
-
- public Normalizer getNormalizer() throws NamingException
- {
- return normalizer;
- }
-
-
- public void setSyntax( Syntax syntax )
- {
- this.syntax = syntax;
- }
-
-
- public void setComparator( Comparator comparator )
- {
- this.comparator = comparator;
- }
-
-
- public void setNormalizer( Normalizer normalizer )
- {
- this.normalizer = normalizer;
- }
- }
-
-
- static class S extends AbstractSyntax
- {
- SyntaxChecker checker;
-
- public S( String oid, boolean humanReadible )
- {
- super( oid, humanReadible );
- }
-
- public void setSyntaxChecker( SyntaxChecker checker )
- {
- this.checker = checker;
- }
-
- public SyntaxChecker getSyntaxChecker() throws NamingException
- {
- return checker;
- }
- }
}