org.eclipse.datatools.sqltools.sqleditor.internal.matching
Class AbstractMatchingPairs

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sqleditor.internal.matching.AbstractMatchingPairs
All Implemented Interfaces:
IMatchingPairs
Direct Known Subclasses:
GeneralMatchingPairs, GenericSQLMatchingPairs

public abstract class AbstractMatchingPairs
extends java.lang.Object
implements IMatchingPairs

The abstract class for matching token pairs.

Author:
juewu

Constructor Summary
AbstractMatchingPairs()
           
 
Method Summary
 java.lang.String getMatchingPattern(java.lang.String token)
          According to the given token retrieving the matching pattern.
 java.lang.String getMatchingPatternClosure(java.lang.String token)
          Getting the related token pattern closure for a specific token.
 boolean isLeftToken(java.lang.String token)
          Determine whether the token is left token.
 boolean isSupportedToken(java.lang.String token)
          Determine whether the token is supported.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMatchingPairs

public AbstractMatchingPairs()
Method Detail

getMatchingPattern

public java.lang.String getMatchingPattern(java.lang.String token)
Description copied from interface: IMatchingPairs
According to the given token retrieving the matching pattern.

Specified by:
getMatchingPattern in interface IMatchingPairs
Parameters:
token - is the one to be matched.
Returns:
If there is no such token supported, return null. Otherwise, return matching pattern.

isSupportedToken

public boolean isSupportedToken(java.lang.String token)
Description copied from interface: IMatchingPairs
Determine whether the token is supported.

Specified by:
isSupportedToken in interface IMatchingPairs
Parameters:
token - a String represents token.
Returns:
If supported, return true. Otherwise, return false.

isLeftToken

public boolean isLeftToken(java.lang.String token)
Description copied from interface: IMatchingPairs
Determine whether the token is left token.

Specified by:
isLeftToken in interface IMatchingPairs
Parameters:
token - a String represents token.
Returns:
If the token is left token, return true. Otherwise, return false.

getMatchingPatternClosure

public java.lang.String getMatchingPatternClosure(java.lang.String token)
Description copied from interface: IMatchingPairs
Getting the related token pattern closure for a specific token. When the matching token of this given token is being searching, only the tokens which match the pattern in related token pattern closure will be focused on.

Specified by:
getMatchingPatternClosure in interface IMatchingPairs
Parameters:
token - is the specific token whose related token pattern is needed.
Returns:
the regular expression presents the related tokens of this specific token.