/** * Asserts whether or not the attribute's value conforms to the attribute * syntax. * * @param value the value of some attribute with the syntax * @throws LdapException if the value does not conform to the attribute syntax. */ public void assertSyntax( Object value ) throws LdapException { if ( !isValidSyntax( value ) ) { throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX ); } }
/** * Uses the syntaxChecker associated with the attributeType to check if the * value is valid. Repeated calls to this method do not attempt to re-check * the syntax of the wrapped value every time if the wrapped value does not * change. Syntax checks only result on the first check, and when the wrapped * value changes. * * @see ServerValue#isValid() */ public final boolean isValid( SyntaxChecker syntaxChecker ) throws LdapException { if ( syntaxChecker == null ) { String message = I18n.err( I18n.ERR_04139, toString() ); LOG.error( message ); throw new LdapException( message ); } valid = syntaxChecker.isValidSyntax( getReference() ); return valid; }
return attributeType.getSyntax().getSyntaxChecker().isValidSyntax( null );
/** * Uses the syntaxChecker associated with the attributeType to check if the * value is valid. Repeated calls to this method do not attempt to re-check * the syntax of the wrapped value every time if the wrapped value does not * change. Syntax checks only result on the first check, and when the wrapped * value changes. * * @see Value#isValid() */ public final boolean isValid() { if ( valid != null ) { return valid; } if ( attributeType != null ) { valid = attributeType.getSyntax().getSyntaxChecker().isValidSyntax( get() ); } else { valid = false; } return valid; }