org.opends.server.core
Class SimpleSubtreeSpecification.Parser

java.lang.Object
  extended by org.opends.server.core.SimpleSubtreeSpecification.Parser
Enclosing class:
SimpleSubtreeSpecification

protected static final class SimpleSubtreeSpecification.Parser
extends java.lang.Object

Internal utility class which can be used by sub-classes to help parse string representations.


Constructor Summary
SimpleSubtreeSpecification.Parser(java.lang.String value)
          Create a new parser for a subtree specification string value.
 
Method Summary
 boolean hasNext()
          Determine if there are remaining tokens.
 boolean hasNextRightBrace()
          Determine if the next token is a right-brace character.
 int nextInt()
          Scans the next token of the input as a non-negative int value.
 java.lang.String nextKey()
          Scans the next token of the input as a key value.
 java.lang.String nextName()
          Scans the next token of the input as a name value.
 void nextSpecificExclusions(java.util.Set<DN> chopBefore, java.util.Set<DN> chopAfter)
          Scans the next tokens of the input as a set of specific exclusions encoded according to the SpecificExclusion production in RFC 3672.
 java.lang.String nextStringValue()
          Scans the next token of the input as a string quoted according to the StringValue production in RFC 3641.
 void skipColon()
          Skip a colon separator.
 void skipLeftBrace()
          Skip a left-brace character.
 void skipRightBrace()
          Skip a right-brace character.
 void skipSeparator()
          Skip a comma separator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSubtreeSpecification.Parser

public SimpleSubtreeSpecification.Parser(java.lang.String value)
Create a new parser for a subtree specification string value.

Parameters:
value - The subtree specification string value.
Method Detail

skipLeftBrace

public void skipLeftBrace()
                   throws java.util.InputMismatchException,
                          java.util.NoSuchElementException
Skip a left-brace character.

Throws:
java.util.InputMismatchException - If the next token is not a left-brace character.
java.util.NoSuchElementException - If input is exhausted.

skipRightBrace

public void skipRightBrace()
                    throws java.util.InputMismatchException,
                           java.util.NoSuchElementException
Skip a right-brace character.

Throws:
java.util.InputMismatchException - If the next token is not a right-brace character.
java.util.NoSuchElementException - If input is exhausted.

skipSeparator

public void skipSeparator()
                   throws java.util.InputMismatchException,
                          java.util.NoSuchElementException
Skip a comma separator.

Throws:
java.util.InputMismatchException - If the next token is not a comma separator character.
java.util.NoSuchElementException - If input is exhausted.

skipColon

public void skipColon()
               throws java.util.InputMismatchException,
                      java.util.NoSuchElementException
Skip a colon separator.

Throws:
java.util.InputMismatchException - If the next token is not a colon separator character.
java.util.NoSuchElementException - If input is exhausted.

hasNextRightBrace

public boolean hasNextRightBrace()
Determine if the next token is a right-brace character.

Returns:
true if and only if the next token is a valid right brace character.

hasNext

public boolean hasNext()
Determine if there are remaining tokens.

Returns:
true if and only if there are remaining tokens.

nextKey

public java.lang.String nextKey()
                         throws java.util.InputMismatchException,
                                java.util.NoSuchElementException
Scans the next token of the input as a key value.

Returns:
The lower-case key value scanned from the input.
Throws:
java.util.InputMismatchException - If the next token is not a valid key string.
java.util.NoSuchElementException - If input is exhausted.

nextName

public java.lang.String nextName()
                          throws java.util.InputMismatchException,
                                 java.util.NoSuchElementException
Scans the next token of the input as a name value.

A name is any string containing only alpha-numeric characters or hyphens, semi-colons, or underscores.

Returns:
The name value scanned from the input.
Throws:
java.util.InputMismatchException - If the next token is not a valid name string.
java.util.NoSuchElementException - If input is exhausted.

nextInt

public int nextInt()
            throws java.util.InputMismatchException,
                   java.util.NoSuchElementException
Scans the next token of the input as a non-negative int value.

Returns:
The name value scanned from the input.
Throws:
java.util.InputMismatchException - If the next token is not a valid non-negative integer string.
java.util.NoSuchElementException - If input is exhausted.

nextStringValue

public java.lang.String nextStringValue()
                                 throws java.util.InputMismatchException,
                                        java.util.NoSuchElementException
Scans the next token of the input as a string quoted according to the StringValue production in RFC 3641.

The return string has its outer double quotes removed and any escaped inner double quotes unescaped.

Returns:
The string value scanned from the input.
Throws:
java.util.InputMismatchException - If the next token is not a valid string.
java.util.NoSuchElementException - If input is exhausted.

nextSpecificExclusions

public void nextSpecificExclusions(java.util.Set<DN> chopBefore,
                                   java.util.Set<DN> chopAfter)
                            throws java.util.InputMismatchException,
                                   java.util.NoSuchElementException,
                                   DirectoryException
Scans the next tokens of the input as a set of specific exclusions encoded according to the SpecificExclusion production in RFC 3672.

Parameters:
chopBefore - The set of chop before local names.
chopAfter - The set of chop after local names.
Throws:
java.util.InputMismatchException - If the common component did not have a valid syntax.
java.util.NoSuchElementException - If input is exhausted.
DirectoryException - If an error occurred when attempting to parse a DN value.