From 22094368c2865dcfb6daf8366425212b721a4657 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Thu, 05 Feb 2009 17:42:14 +0000
Subject: [PATCH] Merge ASN1 branch to trunk
---
opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java | 30 +++++++++++++-----------------
1 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java b/opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java
index 7d64204..2384026 100644
--- a/opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java
+++ b/opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java
@@ -40,13 +40,9 @@
import org.opends.server.api.SubstringMatchingRule;
import org.opends.server.config.ConfigException;
import org.opends.server.core.DirectoryServer;
-import org.opends.server.types.ByteString;
-import org.opends.server.types.DirectoryException;
-import org.opends.server.types.ResultCode;
-
-import org.opends.server.types.DebugLogLevel;
+import org.opends.server.types.*;
import static org.opends.server.loggers.ErrorLogger.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -99,6 +95,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void initializeSyntax(AttributeSyntaxCfg configuration)
throws ConfigException
{
@@ -134,6 +131,7 @@
*
* @return The common name for this attribute syntax.
*/
+ @Override
public String getSyntaxName()
{
return SYNTAX_MATCHING_RULE_NAME;
@@ -146,6 +144,7 @@
*
* @return The OID for this attribute syntax.
*/
+ @Override
public String getOID()
{
return SYNTAX_MATCHING_RULE_OID;
@@ -158,6 +157,7 @@
*
* @return A description for this attribute syntax.
*/
+ @Override
public String getDescription()
{
return SYNTAX_MATCHING_RULE_DESCRIPTION;
@@ -173,6 +173,7 @@
* attributes with this syntax, or <CODE>null</CODE> if equality
* matches will not be allowed for this type by default.
*/
+ @Override
public EqualityMatchingRule getEqualityMatchingRule()
{
return defaultEqualityMatchingRule;
@@ -188,6 +189,7 @@
* attributes with this syntax, or <CODE>null</CODE> if ordering
* matches will not be allowed for this type by default.
*/
+ @Override
public OrderingMatchingRule getOrderingMatchingRule()
{
return defaultOrderingMatchingRule;
@@ -203,6 +205,7 @@
* attributes with this syntax, or <CODE>null</CODE> if substring
* matches will not be allowed for this type by default.
*/
+ @Override
public SubstringMatchingRule getSubstringMatchingRule()
{
return defaultSubstringMatchingRule;
@@ -218,6 +221,7 @@
* attributes with this syntax, or <CODE>null</CODE> if approximate
* matches will not be allowed for this type by default.
*/
+ @Override
public ApproximateMatchingRule getApproximateMatchingRule()
{
// There is no approximate matching rule by default.
@@ -238,12 +242,13 @@
* @return <CODE>true</CODE> if the provided value is acceptable for use with
* this syntax, or <CODE>false</CODE> if not.
*/
- public boolean valueIsAcceptable(ByteString value,
+ @Override
+ public boolean valueIsAcceptable(ByteSequence value,
MessageBuilder invalidReason)
{
// Get string representations of the provided value using the provided form
// and with all lowercase characters.
- String valueStr = value.stringValue();
+ String valueStr = value.toString();
String lowerStr = toLowerCase(valueStr);
@@ -294,11 +299,6 @@
}
- // The next set of characters must be the OID. Strictly speaking, this
- // should only be a numeric OID, but we'll also allow for the
- // "ocname-oid" case as well. Look at the first character to figure out
- // which we will be using.
- int oidStartPos = pos;
if (isDigit(c))
{
// This must be a numeric OID. In that case, we will accept only digits
@@ -362,17 +362,12 @@
// If we're at the end of the value, then it isn't a valid matching rule
// description. Otherwise, parse out the OID.
- String oid;
if (pos >= length)
{
invalidReason.append(ERR_ATTR_SYNTAX_MR_TRUNCATED_VALUE.get(valueStr));
return false;
}
- else
- {
- oid = lowerStr.substring(oidStartPos, (pos-1));
- }
// Skip over the space(s) after the OID.
@@ -1150,6 +1145,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean isBinary()
{
return false;
--
Gitblit v1.10.0