com.sage.orion.sdata.servlet
Class MaskBuilder

java.lang.Object
  extended by com.sage.orion.sdata.servlet.MaskBuilder

public class MaskBuilder
extends java.lang.Object

MaskBuilder assists in building a mask pattern for the schema restriction. This is initially designed to assist application developers in creating a presentation mask for service fields of a service operation.


Nested Class Summary
static class MaskBuilder.CaseType
           
static class MaskBuilder.PrintCaseType
           
static class MaskBuilder.StringSegmentType
           
 
Constructor Summary
MaskBuilder()
           
 
Method Summary
 MaskBuilder append(char fromAlphaNumericChar, char toAlphaNumericChar, int minLength, int maxLength)
          Appends the pattern mask for the specified from and to alphanumeric character for a specified length.
 MaskBuilder append(MaskBuilder.StringSegmentType stringSegmentType, MaskBuilder.CaseType caseType, int minLength, int maxLength)
          Appends onto the current mask based on segment type, case and langth.
 MaskBuilder append(MaskDataTypeBuilder maskDataTypeBuilder, int minLength, int maxLength)
          Appends the mask data type into the mask for a specified length.
 MaskBuilder appendDigits(int minLength, int maxLength)
          Appends the digit data type mask of a specified length.
 MaskBuilder appendLiteral(java.lang.String unescapedLiteralString)
          Appends a literal string to the mask.
 MaskBuilder appendLiteral(java.lang.String unescapedLiteralString, int minLength, int maxLength)
          Appends a literal string to a mask for a specified length.
 MaskBuilder appendMaskLength(int minLength, int maxLength)
          Appends the length clause onto the mask.
 MaskBuilder appendPrint(MaskBuilder.PrintCaseType printCaseType, int minLength, int maxLength)
          Appends the print pattern mask for a specified case and length.
 void clearMask()
          Clears the mask value to an empty string.
 java.lang.String getMask()
          Gets the mask created by the append commands.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MaskBuilder

public MaskBuilder()
Method Detail

appendDigits

public MaskBuilder appendDigits(int minLength,
                                int maxLength)
Appends the digit data type mask of a specified length.

Parameters:
minLength - minimum length allowed for this pattern.
maxLength - maximum length allowed for this pattern.
Returns:
this instance of MaskBuilder

getMask

public java.lang.String getMask()
Gets the mask created by the append commands.

Returns:
a non-null String containing the current value of the mask that is being built.

clearMask

public void clearMask()
Clears the mask value to an empty string.


append

public MaskBuilder append(MaskBuilder.StringSegmentType stringSegmentType,
                          MaskBuilder.CaseType caseType,
                          int minLength,
                          int maxLength)
Appends onto the current mask based on segment type, case and langth.

Parameters:
stringSegmentType - MaskBuilder.StringSegmentType
caseType - is the segment's MaskBuilder.CaseType
minLength - is the minimum length of the pattern.
maxLength - is the maximum length of the pattern.
Returns:
this instance of MaskBuilder

appendMaskLength

public MaskBuilder appendMaskLength(int minLength,
                                    int maxLength)
Appends the length clause onto the mask.

Parameters:
minLength - is the minimum length of the pattern.
maxLength - is the maximum length of the pattern.
Returns:
this instance of MaskBuilder

append

public MaskBuilder append(MaskDataTypeBuilder maskDataTypeBuilder,
                          int minLength,
                          int maxLength)
Appends the mask data type into the mask for a specified length.

Parameters:
maskDataTypeBuilder - is the mask data type builder MaskDataTypeBuilder
minLength - is the minimum length of the pattern.
maxLength - is the maximum length of the pattern.
Returns:
this instance of MaskBuilder

append

public MaskBuilder append(char fromAlphaNumericChar,
                          char toAlphaNumericChar,
                          int minLength,
                          int maxLength)
Appends the pattern mask for the specified from and to alphanumeric character for a specified length.

Parameters:
fromAlphaNumericChar - is the range from alphanumeric character of the mask data type.
toAlphaNumericChar - is the range to alphanumeric character of the mask data type.
minLength - is the minimum length of the pattern.
maxLength - is the maximum length of the pattern.
Returns:
this instance of MaskBuilder

appendPrint

public MaskBuilder appendPrint(MaskBuilder.PrintCaseType printCaseType,
                               int minLength,
                               int maxLength)
Appends the print pattern mask for a specified case and length.

Parameters:
printCaseType - MaskBuilder.PrintCaseType
minLength - is the minimum length of the pattern.
maxLength - is the maximum length of the pattern.
Returns:
this instance of MaskBuilder

appendLiteral

public MaskBuilder appendLiteral(java.lang.String unescapedLiteralString)
Appends a literal string to the mask. Special characters will be escaped. These are open and close brackets {}, open and close square brackets [], and open and closed parentheses ()

Parameters:
unescapedLiteralString - is the unescaped literal string.
Returns:
this instance of MaskBuilder

appendLiteral

public MaskBuilder appendLiteral(java.lang.String unescapedLiteralString,
                                 int minLength,
                                 int maxLength)
Appends a literal string to a mask for a specified length. These are open and close brackets {}, open and close square brackets [], and open and closed parentheses ()

Parameters:
unescapedLiteralString - is the unescaped literal string.
minLength - is the minimum length of the pattern.
maxLength - is the maximum length of the pattern.
Returns:
this instance of MaskBuilder

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 Sage Software, Inc. All rights reserved.