|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.services.StandardManager
wt.eff.format.StandardEffFormatService
public class StandardEffFormatService
Standard implementation of the EffFormatService interface.
Note: All implementing methods that accept range values trim (@link
java.lang.String#trim()} them before sending it to the actual format
implementations to provide consistentency in the implementation logic
from the service perspective.
Use the newStandardEffFormatService static factory method(s),
not the StandardEffFormatService constructor, to construct
instances of this class. Instances must be constructed using the static
factory(s), in order to ensure proper initialization of the instance.
Supported API: true
Extendable: false
EffFormatService,
EffFormatException,
Serialized Form| Method Summary | |
|---|---|
String |
addToRangeValue(String rangeValue,
int amount,
EffState state)
Add the amount to the effecitivity range value passed in. |
int |
compareRangeValues(String leftValue,
String rightValue,
EffState state)
This operation is used by Windchill to find whether the left and right eff. |
String |
decrementRangeValue(String rangeValue,
EffState state)
Decrements the effecitivity range value passed in by 1. |
String |
incrementRangeValue(String rangeValue,
EffState state)
Increments the effecitivity range value passed in by 1. |
boolean |
isAdjacentTo(String leftValue,
String rightValue,
EffState state)
This operation is used by Windchill to find whether the left and right eff. |
boolean |
supportsRangeArithmetic(EffState state)
Determines whether range arithmetic is supported for the criteria specified in the state object. |
String |
validateRangeValues(EffRangeValues range,
EffState state)
Checks whether the range value adheres to right format. |
| Methods inherited from class wt.services.StandardManager |
|---|
getManagerService, getManagerStatus, getName, getStartupType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public String validateRangeValues(EffRangeValues range,
EffState state)
throws WTException
String error message is returned on those occasions stating
the reasons for its invalidity. An empty String ("")
object signifies that the range value passed in is valid.
#normalizeRangeValues(EffRangeValues
range, EffState state)).
// create EffRangeValues and EffState instances
rangeValues = EffFormatHelper.service.normalizeRangeValues(rangeValues,
state); // get normalized range values
String errStr = EffFormatHelper.service.validateRangeValues(rangeValues,
state);
if (EffFormatHelper.isEmptyOrNull(errStr)) {
// valid
// EffFormat implementations return an empty string when the range
values are valid
} else {
// errStr details the error condition
// EffFormat implementations return a non-empty string when the
range values are invalid
}
An effectivity range is considered valid when the following conditions
are true:
validateRangeValues in interface EffFormatServicerangeValues - an EffRangeValues object that contains
the string range values to be validated. UnitEffFormat's validate
considering their format's logic. DateEffFormat's validate it considering
a string value having a pattern supported by the system's locale.
See wt.query.dateHelperResource for a list of valid format
patterns available for a particular locale. Null values are valid
values and are treated as invalid and hence an appropriate String
error message is returned.state - a wt.eff.format.EffState object recording
the the various attributes of interest to the this operation
null
value is never returned.
wt.eff.EffFormatExceptionwhen - the range or state
parameter is null
WTException
public int compareRangeValues(String leftValue,
String rightValue,
EffState state)
throws WTException
compareRangeValues in interface EffFormatServiceleftValue - this value is expected to be a valid string
representing a unit number for UnitEffFormat's. For DateEffFormat's
this value is expected to be a valid string representation
of the time in milliseconds since January 1, 1970, 00:00:00 GMT, which
is generally obtained by calling the java.sql.Timestamp.getTime()
method to get the long time value and then converting it to a String
object by using the static java.lang.Long.toString()
method. Null values are not valid values and an EffFormatException
(unchecked) is thrown on those occasions. Also, the range value must
be a valid one.rightValue - this value is expected to be a validstring
representing a unit number for UnitEffFormat's. For DateEffFormat's
this value is expected to be a valid string representation
of the time in milliseconds since January 1, 1970, 00:00:00 GMT, which
is generally obtained by calling the java.sql.Timestamp.getTime()
method to get the long time value and then converting it to a String
object by using the static java.lang.Long.toString()
method. Null values are not valid values and an EffFormatException
(unchecked) is thrown on those occasions. Also, the range value must
be a valid one.state - a wt.eff.format.EffState object recording
the the various attributes of interest to the this operation
0 if the left effectivity value is
equal to right effectivity value; a value less than 0
if the left effectivity value is less than the right effectivity value;
and a value greater than 0 if this left effectivity value
is greater than the right effectivity value.
wt.eff.EffFormatExceptionwhen - the leftValue,
rightValue or state parameter is null.
wt.eff.EffFormatExceptionwhen - the leftValue or
rightValue is invalid. Only valid range values are accepted by this
method and hence the range values must be first validated.
WTException
public boolean isAdjacentTo(String leftValue,
String rightValue,
EffState state)
throws WTException
isAdjacentTo in interface EffFormatServiceleftValue - this value is expected to be a valid string
representing a unit number for UnitEffFormat's. For DateEffFormat's
this value is expected to be a valid string representation
of the time in milliseconds since January 1, 1970, 00:00:00 GMT, which
is generally obtained by calling the java.sql.Timestamp.getTime()
method to get the long time value and then converting it to a String
object by using the static java.lang.Long.toString()
method. Null values are not valid values and an EffFormatException
(unchecked) is thrown on those occasions. Also, the range value must
be a valid one.rightValue - this value is expected to be a validstring
representing a unit number for UnitEffFormat's. For DateEffFormat's
this value is expected to be a valid string representation
of the time in milliseconds since January 1, 1970, 00:00:00 GMT, which
is generally obtained by calling the java.sql.Timestamp.getTime()
method to get the long time value and then converting it to a String
object by using the static java.lang.Long.toString()
method. Null values are not valid values and an EffFormatException
(unchecked) is thrown on those occasions. Also, the range value must
be a valid one.state - a wt.eff.format.EffState object recording
the the various attributes of interest to the this operation
0 if the left effectivity value is
equal to right effectivity value; a value less than 0
if the left effectivity value is less than the right effectivity value;
and a value greater than 0 if this left effectivity value
is greater than the right effectivity value.
wt.eff.EffFormatExceptionwhen - the leftValue,
rightValue or state parameter is null.
wt.eff.EffFormatExceptionwhen - the leftValue or
rightValue is invalid. Only valid range values are accepted by this
method and hence the range values must be first validated.
WTException
public boolean supportsRangeArithmetic(EffState state)
throws WTException
state object. Windchill uses range arithmetic
for operations such as sibling propagation (closing-off effectivity
range values of prior versions). In order to support range arithmetic,
an effectivity format must provide an implementation of the #addToRangeValue(String, int, EffState, java.util.Map{@literal }) operation.
true value. See the
Customizer's Guide to find out more about range arithmetic operations
and how they can be used to support operations like closing off prior
effectivity ranges.
supportsRangeArithmetic in interface EffFormatServicestate -
WTExceptionaddToRangeValue(String, int, EffState)
public String addToRangeValue(String rangeValue,
int amount,
EffState state)
throws WTException
addToRangeValue in interface EffFormatServicerangeValue - this value is expected to be a validstring
representing a unit number for UnitEffFormat's. For DateEffFormat's
this value is expected to be a valid string representation
of the time in milliseconds since January 1, 1970, 00:00:00 GMT, which
is generally obtained by calling the java.sql.Timestamp.getTime()
method to get the long time value and then converting it to a String
object by using the static java.lang.Long.toString()
method. Null values are not valid values and an EffFormatException
(unchecked) is thrown on those occasions. Also, the range value must
be a valid one.amount - the value to be added (if positive) or subtracted (if
negative) from the rangeValuestate - a wt.eff.format.EffState object recording
the the various attributes of interest to the this operation
wt.eff.EffFormatExceptionwhen - the rangeValue
or state parameter is null.
wt.eff.EffFormatExceptionwhen - the rangeValue
is invalid. Only valid range values are accepted by this method and
hence the range value must be first validated.
WTException#supportsRangeArithmetic()
public String incrementRangeValue(String rangeValue,
EffState state)
throws WTException
incrementRangeValue in interface EffFormatServicerangeValue - this value is expected to be a validstring
representing a unit number for UnitEffFormat's. For DateEffFormat's
this value is expected to be a valid string representation
of the time in milliseconds since January 1, 1970, 00:00:00 GMT, which
is generally obtained by calling the java.sql.Timestamp.getTime()
method to get the long time value and then converting it to a String
object by using the static java.lang.Long.toString()
method. Null values are not valid values and an EffFormatException
(unchecked) is thrown on those occasions. Also, the range value must
be a valid one.state - a wt.eff.format.EffState object recording
the the various attributes of interest to the this operation
wt.eff.EffFormatExceptionwhen - the rangeValue
or state parameter is null.
wt.eff.EffFormatExceptionwhen - the rangeValue
is invalid. Only valid range values are accepted by this method and
hence the range value must be first validated.
WTException#supportsRangeArithmetic(),
addToRangeValue(String, int, EffState)
public String decrementRangeValue(String rangeValue,
EffState state)
throws WTException
decrementRangeValue in interface EffFormatServicerangeValue - this value is expected to be a validstring
representing a unit number for UnitEffFormat's. For DateEffFormat's
this value is expected to be a valid string representation
of the time in milliseconds since January 1, 1970, 00:00:00 GMT, which
is generally obtained by calling the java.sql.Timestamp.getTime()
method to get the long time value and then converting it to a String
object by using the static java.lang.Long.toString()
method. Null values are not valid values and an EffFormatException
(unchecked) is thrown on those occasions. Also, the range value must
be a valid one.state - a wt.eff.format.EffState object recording
the the various attributes of interest to the this operation
wt.eff.EffFormatExceptionwhen - the rangeValue
or state parameter is null.
wt.eff.EffFormatExceptionwhen - the rangeValue
is invalid. Only valid range values are accepted by this method and
hence the range value must be first validated.
WTException#supportsRangeArithmetic(),
addToRangeValue(String, int, EffState)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||