| Modifier and Type | Field and Description |
|---|---|
static String |
VT_CREDIT_CARD
"creditCard"
|
static String |
VT_DOUBLE_RANGE
"doubleRange"
|
static String |
VT_EMAIL
"email"
|
static String |
VT_EQUAL
"equal"
|
static String |
VT_FLOAT_RANGE
"floatRange"
|
static String |
VT_INT_RANGE
"intRange"
|
static String |
VT_MASK
"mask"
|
static String |
VT_MAX_LENGTH
"maxlength"
|
static String |
VT_MIN_LENGTH
"minlength"
|
static String |
VT_REQUIRED
"required"
|
static String |
VT_URL
"url"
|
static String |
VT_VALID_WHEN
"validwhen"
|
| Constructor and Description |
|---|
JSFUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
calcSerialVersionUID(StringBuilder buffer) |
int |
calculateIcefacesTimeout(String string) |
static String |
constructDummyArrayDeclaration(String name,
int count)
Constructs a string representing an array initialization in Java.
|
static String |
getDate()
Returns the current Date
|
static String |
getDate(String format)
Returns the current Date in the specified format.
|
static String |
getDateFormat(String format) |
static String |
getEqual(ModelElementFacade element)
Retrieves the "equal" value from the given element (if one is present).
|
static String |
getEqual(ModelElementFacade element,
ParameterFacade ownerParameter)
Retrieves the "equal" value from the given element (if one is present).
|
static String |
getFormat(ModelElementFacade element,
ClassifierFacade type,
String defaultDateFormat,
String defaultTimeFormat)
Gets the format string for the given
element. |
static String |
getInputFormat(ModelElementFacade element)
Retrieves the input format (if one is defined), for the given
element. |
static String |
getMaxLengthValue(String format) |
static String |
getMinLengthValue(String format) |
static String |
getPatternValue(String format) |
static String |
getRangeEnd(String format) |
static String |
getRangeStart(String format) |
String |
getRequestClassName() |
String |
getResponseClassName() |
String |
getSessionClassName() |
static String |
getToken(String string,
int index,
int limit) |
static Collection |
getValidatorArgs(ModelElementFacade element,
String validatorType)
Gets the validator args for the
element and the given validatorType. |
static Collection<String> |
getValidatorTypes(ModelElementFacade element,
ClassifierFacade type)
Retrieves the validator types as a collection from the given
element (if any can be retrieved). |
static Collection<List<String>> |
getValidatorVars(ModelElementFacade element,
ClassifierFacade type,
ParameterFacade ownerParameter)
Gets the validator variables for the given
element (if they can
be retrieved). |
static String |
getValidWhen(ModelElementFacade element)
Retrieves the "validwhen" value from the given element (if one is present).
|
String |
getViewExtension()
Gets the extension for the view type.
|
static boolean |
isByte(ClassifierFacade type) |
static boolean |
isCreditCardFormat(String format)
Indicates if the given
format is a credit card format. |
static boolean |
isDate(ClassifierFacade type) |
static boolean |
isDouble(ClassifierFacade type) |
static boolean |
isEmailFormat(String format)
Indicates if the given
format is an email format. |
static boolean |
isEqualFormat(String format)
Indicates if the given
format is an equal format. |
static boolean |
isFloat(ClassifierFacade type) |
static boolean |
isInteger(ClassifierFacade type) |
static boolean |
isLong(ClassifierFacade type) |
static boolean |
isMaxLengthFormat(String format)
Indicates if the given
format is a maxlength format. |
static boolean |
isMinLengthFormat(String format)
Indicates if the given
format is a minlength format. |
static boolean |
isPatternFormat(String format)
Indicates if the given
format is a pattern format. |
static boolean |
isRangeFormat(String format)
Indicates if the given
format is a range format. |
static boolean |
isReadOnly(ModelElementFacade element)
Indicates if the given element is read-only or not.
|
static boolean |
isShort(ClassifierFacade type) |
static boolean |
isStrictDateFormat(ModelElementFacade element)
Indicates whether or not the format for this element is a strict date
format.
|
static boolean |
isStrictDateFormat(String format) |
static boolean |
isString(ClassifierFacade type) |
static boolean |
isTime(ClassifierFacade type) |
static boolean |
isUrl(ClassifierFacade type) |
static List<String> |
parseValidatorArgs(String validatorTaggedValue)
Reads the validator arguments from the the given tagged value.
|
static String |
parseValidatorName(String validatorTaggedValue)
Parses the validator name for a tagged value.
|
static List<String> |
parseValidatorVars(String validatorTaggedValue)
Reads the validator variable names from the the given tagged value.
|
void |
setPortletContainer(String portletContainer) |
void |
setStrictDateTimeFormat(boolean strictDateTimeFormat)
Sets whether or not the date patterns should be treated as strict.
|
static String |
toWebResourceName(String string)
Converts the argument into a web resource name, this means: all lowercase
characters and words are separated with dashes.
|
public static final String VT_REQUIRED
public static final String VT_URL
public static final String VT_INT_RANGE
public static final String VT_FLOAT_RANGE
public static final String VT_DOUBLE_RANGE
public static final String VT_EMAIL
public static final String VT_CREDIT_CARD
public static final String VT_MIN_LENGTH
public static final String VT_MAX_LENGTH
public static final String VT_MASK
public static final String VT_VALID_WHEN
public static final String VT_EQUAL
public JSFUtils()
public static String toWebResourceName(String string)
string - any stringpublic static List<String> parseValidatorArgs(String validatorTaggedValue)
validatorTaggedValue - IllegalArgumentException - when the input string does not match the required patternpublic static List<String> parseValidatorVars(String validatorTaggedValue)
validatorTaggedValue - IllegalArgumentException - when the input string does not match the required patternpublic static String parseValidatorName(String validatorTaggedValue)
validatorTaggedValue - IllegalArgumentException - when the input string does not match the required patternpublic static String constructDummyArrayDeclaration(String name, int count)
name - the name to give the array.count - the number of items to give the array.public static String getDateFormat(String format)
format - public static String getDate(String format)
format - The format for the output datepublic static String getDate()
public static boolean isStrictDateFormat(String format)
format - true if this field's value needs to conform to a
strict date format, false otherwisepublic static boolean isEmailFormat(String format)
format is an email format.format - true if this field is to be formatted as an email
address, false otherwisepublic static boolean isEqualFormat(String format)
format is an equal format.format - true if this field is to be formatted as an
email address, false otherwisepublic static boolean isCreditCardFormat(String format)
format is a credit card format.format - true if this field is to be formatted as a credit card, false otherwisepublic static boolean isPatternFormat(String format)
format is a pattern format.format - true if this field's value needs to respect a certain pattern, false otherwisepublic static boolean isMinLengthFormat(String format)
format is a minlength format.format - true if this field's value needs to consist of at least a certain
number of characters, false otherwisepublic static boolean isMaxLengthFormat(String format)
format is a maxlength format.format - true if this field's value needs to consist of at maximum a certain
number of characters, false otherwisepublic static String getToken(String string, int index, int limit)
string - index - limit - public static String getInputFormat(ModelElementFacade element)
element.element - the model element for which to retrieve the input format.public static boolean isRangeFormat(String format)
format is a range format.format - true if this field's value needs to be in a specific range, false otherwisepublic static boolean isByte(ClassifierFacade type)
type - true if the type of this field is a byte, false otherwisepublic static boolean isShort(ClassifierFacade type)
type - true if the type of this field is a short, false otherwisepublic static boolean isInteger(ClassifierFacade type)
type - true if the type of this field is an integer, false otherwisepublic static boolean isLong(ClassifierFacade type)
type - true if the type of this field is a long integer, false otherwisepublic static boolean isFloat(ClassifierFacade type)
type - true if the type of this field is a floating point, false otherwisepublic static boolean isDouble(ClassifierFacade type)
type - true if the type of this field is a double precision floating point,
false otherwisepublic static boolean isDate(ClassifierFacade type)
type - true if the type of this field is a date, false otherwisepublic static boolean isTime(ClassifierFacade type)
type - true if the type of this field is a time, false otherwisepublic static boolean isUrl(ClassifierFacade type)
type - true if the type of this field is a URL, false otherwisepublic static boolean isString(ClassifierFacade type)
type - true if the type of this field is a String,
false otherwisepublic static boolean isReadOnly(ModelElementFacade element)
element - the element to check.public static String getEqual(ModelElementFacade element)
element - the element from which to retrieve the equal value.public static String getEqual(ModelElementFacade element, ParameterFacade ownerParameter)
element - the element from which to retrieve the equal value.ownerParameter - the optional owner parameter (specified if the element is an attribute).public static String getValidWhen(ModelElementFacade element)
element - the element from which to retrieve the validwhen value.public static String getRangeStart(String format)
format - public static String getRangeEnd(String format)
format - public static String getMinLengthValue(String format)
format - public static String getMaxLengthValue(String format)
format - public static String getPatternValue(String format)
format - public static Collection<String> getValidatorTypes(ModelElementFacade element, ClassifierFacade type)
element (if any can be retrieved).element - the element from which to retrieve the types.type - the type of the element.public static Collection<List<String>> getValidatorVars(ModelElementFacade element, ClassifierFacade type, ParameterFacade ownerParameter)
element (if they can
be retrieved).element - the element from which to retrieve the variablestype - the type of the element.ownerParameter - the optional owner parameter (if the element is an attribute for example).public static Collection getValidatorArgs(ModelElementFacade element, String validatorType)
element and the given validatorType.element - the element for which to retrieve the arguments.validatorType - the validator type name.public void setStrictDateTimeFormat(boolean strictDateTimeFormat)
strictDateTimeFormat - public static boolean isStrictDateFormat(ModelElementFacade element)
element - public static String getFormat(ModelElementFacade element, ClassifierFacade type, String defaultDateFormat, String defaultTimeFormat)
element.element - the element for which to retrieve the format.type - the type of the element.defaultDateFormat - defaultTimeFormat - public String getViewExtension()
public void setPortletContainer(String portletContainer)
portletContainer - public String getRequestClassName()
public String getResponseClassName()
public String getSessionClassName()
public static String calcSerialVersionUID(StringBuilder buffer)
buffer - public int calculateIcefacesTimeout(String string)
string - Copyright © 2003–2014 AndroMDA.org. All rights reserved.