Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.singularsys.jep.configurableparser.matchers
Class StringTokenMatcher

    java.lang.Object
      com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
          com.singularsys.jep.configurableparser.matchers.StringTokenMatcher

All Implemented Interfaces:
  TokenBuilder, TokenMatcher, java.io.Serializable

    public class StringTokenMatcher

extends RegExpTokenMatcher

Base class for matching quoted strings. TODO cope with string like "a\"b" with escaped quote marks.

See Also:
  Serialized Form

Constructor Summary
`StringTokenMatcher(java.util.regex.Pattern pattern, char delim)`
`StringTokenMatcher(java.lang.String regex)`

Method Summary
`Token` | `buildToken(java.lang.String s)` Builds a token following a successful match.
`static StringTokenMatcher` | `doubleQuoteStringMatcher()` Factory for matching single line double quoted strings.
`void` | `init(Jep j)` Initialize the matcher when the Jep instance is known.
`Token` | `match(java.lang.String s)` Attempts to match the start of the string.
`static StringTokenMatcher` | `singleQuoteStringMatcher()` Factory for matching single line single quoted strings.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### StringTokenMatcher

    public StringTokenMatcher(java.util.regex.Pattern pattern,
                              char delim)

### StringTokenMatcher

    public StringTokenMatcher(java.lang.String regex)

Method Detail

### match

    public Token match(java.lang.String s)

  Description copied from class: `RegExpTokenMatcher`
  Attempts to match the start of the string.

  Specified by:
    `match` in interface `TokenMatcher`
  Overrides:
    `match` in class `RegExpTokenMatcher`
  Parameters:
    `s` - the string to match against
  Returns:
    if successful returns the corresponding token, return null if failed to match

### doubleQuoteStringMatcher

    public static StringTokenMatcher doubleQuoteStringMatcher()

  Factory for matching single line double quoted strings.

### singleQuoteStringMatcher

    public static StringTokenMatcher singleQuoteStringMatcher()

  Factory for matching single line single quoted strings.

### buildToken

    public Token buildToken(java.lang.String s)

  Description copied from class: `RegExpTokenMatcher`
  Builds a token following a successful match.

  Specified by:
    `buildToken` in interface `TokenBuilder`
  Specified by:
    `buildToken` in class `RegExpTokenMatcher`
  Parameters:
    `s` - String representing the completed matched token
  Returns:
    the appropriate type of token.

### init

    public void init(Jep j)

  Description copied from interface: `TokenMatcher`
  Initialize the matcher when the Jep instance is known.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2007 Singular Systems http://www.singularsys.com/jep