org.apache.directory.shared.ldap.schema.syntax
Class CountrySyntaxChecker

java.lang.Object
  extended by org.apache.directory.shared.ldap.schema.syntax.CountrySyntaxChecker
All Implemented Interfaces:
SyntaxChecker

public class CountrySyntaxChecker
extends java.lang.Object
implements SyntaxChecker

A SyntaxChecker which verifies that a value is a country according to RFC 4517. From RFC 4517 : A value of the Country String syntax is one of the two-character codes from ISO 3166 [ISO3166] for representing a country.


Field Summary
static java.lang.String DEFAULT_OID
          The Syntax OID, according to RFC 4517, par.
 
Constructor Summary
CountrySyntaxChecker()
          Creates a new instance of CountrySyntaxChecker.
CountrySyntaxChecker(java.lang.String oid)
           
 
Method Summary
 void assertSyntax(java.lang.Object value)
          Asserts whether or not the attribute's value conforms to the attribute syntax.
 java.lang.String getSyntaxOid()
          Gets the OID of the attribute syntax.
 boolean isValidSyntax(java.lang.Object value)
          Determines if the attribute's value conforms to the attribute syntax.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_OID

public static final java.lang.String DEFAULT_OID
The Syntax OID, according to RFC 4517, par. 3.3.4

See Also:
Constant Field Values
Constructor Detail

CountrySyntaxChecker

public CountrySyntaxChecker(java.lang.String oid)

CountrySyntaxChecker

public CountrySyntaxChecker()
Creates a new instance of CountrySyntaxChecker.

Method Detail

assertSyntax

public void assertSyntax(java.lang.Object value)
                  throws javax.naming.NamingException
Description copied from interface: SyntaxChecker
Asserts whether or not the attribute's value conforms to the attribute syntax.

Specified by:
assertSyntax in interface SyntaxChecker
Parameters:
value - the value of some attribute with the syntax
Throws:
javax.naming.NamingException - if the value does not conform to the attribute syntax.

getSyntaxOid

public java.lang.String getSyntaxOid()
Description copied from interface: SyntaxChecker
Gets the OID of the attribute syntax.

Specified by:
getSyntaxOid in interface SyntaxChecker
Returns:
the object identifier of the Syntax this SyntaxChecker validates

isValidSyntax

public boolean isValidSyntax(java.lang.Object value)
Description copied from interface: SyntaxChecker
Determines if the attribute's value conforms to the attribute syntax.

Specified by:
isValidSyntax in interface SyntaxChecker
Parameters:
value - the value of some attribute with the syntax
Returns:
true if the value is in the valid syntax, false otherwise