|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.stanwood.media.database.DBRegExpTokenMapping
public class DBRegExpTokenMapping
This is used to translate DB tokens from MySQL to another database. It does this through the use of regular expressions. If the regular expression is used to extract groups from the SQL, then these can be placed in the native token, via the syntax $1....$n for groups 1....n.
Constructor Summary | |
---|---|
DBRegExpTokenMapping(java.lang.String mysqlRegexp,
java.lang.String nativeToken)
Used to construct a regular expression token mapping. |
Method Summary | |
---|---|
boolean |
accept(java.lang.String token)
Part of the SQL is passed into this method. |
java.lang.String |
getNativeToken()
If this mapping handled a token with accept(String) was called,
then this will return the replacement token. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBRegExpTokenMapping(java.lang.String mysqlRegexp, java.lang.String nativeToken)
mysqlRegexp
- The regular expression to match on.nativeToken
- The returned token pattern.Method Detail |
---|
public boolean accept(java.lang.String token)
accept
in interface IDBTokenMappings
token
- The SQL token that is been checked
public java.lang.String getNativeToken()
accept(String)
was called,
then this will return the replacement token.
getNativeToken
in interface IDBTokenMappings
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |