|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.org.jcam.util.Mask
public class Mask
uk.org.jcam.util.Mask Utility class used to check Contents against Mask Statements It contains an abstract inner class abstractMask that is used to build the various Mask classes. There are three Mask classes dateMask, numberMask and String Mask. The key to the mask function is the convertToRegex method that takes the Mask and creates a Regular Expression that will check for the Mask The check method then simply uses the java.util.regex.Pattern method to check the input string against the pre-built mask. //TODO Mask - applyMask Currently the application of output Masks has not been implemented. //TODO Mask - input and output masks
| Nested Class Summary | |
|---|---|
class |
Mask.dateMask
|
class |
Mask.MaskException
|
class |
Mask.numberMask
cam.util.numberMask Inner class extending the abstractMask class to implement the Number Mask functionality The following characters ar significant in Number Masks: 0 mandatory |
class |
Mask.stringMask
cam.util.stringMask Inner class extending the abstractMask class to implement the String Mask functionality The following Characters are significant in String Masks: X for a mandatory character . |
| Field Summary | |
|---|---|
static java.lang.String |
MASK_DATE
|
static java.lang.String |
MASK_NUMBER
|
static java.lang.String |
MASK_STRING
|
| Constructor Summary | |
|---|---|
Mask(java.lang.String mask,
java.lang.String type)
Mask |
|
| Method Summary | |
|---|---|
java.lang.String |
apply(java.lang.String string)
apply Takes the input string and changes it according to the output mask |
boolean |
check(java.lang.String string)
check Calls the Masks check routine that will check the the input string against the Mask |
java.lang.String |
getExpandedMask()
getExpandedMask Masks can contain shorthand statements indicating repeating character types. |
java.lang.String |
getRegex()
getRegex Returns the Regular Expression that is created to implement the mask |
java.lang.String |
getType()
getType Returns the type of Mask |
static void |
setDebug(boolean b)
setDebug |
static void |
setTrace(boolean trace)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MASK_STRING
public static final java.lang.String MASK_NUMBER
public static final java.lang.String MASK_DATE
| Constructor Detail |
|---|
public Mask(java.lang.String mask,
java.lang.String type)
throws Mask.MaskException
mask - A String containing the masktype - A String indicating the type of Mask either "Date", "Number" or "String"
Mask.MaskException - Exception thrown by the mask constructor.| Method Detail |
|---|
public java.lang.String apply(java.lang.String string)
string - A String to which the output mask should be applied
public boolean check(java.lang.String string)
string - The String to be checked against the mask
public java.lang.String getType()
public java.lang.String getExpandedMask()
public java.lang.String getRegex()
public static void setDebug(boolean b)
b - public static void setTrace(boolean trace)
trace - The trace to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||