public final class DatatypeConverter extends Object
Constructor and Description |
---|
DatatypeConverter() |
Modifier and Type | Method and Description |
---|---|
static AccrueType |
parseAccrueType(String value)
Parse an accrue type.
|
static BookingType |
parseBookingType(String value)
Parse a booking type.
|
static Boolean |
parseBoolean(String value)
Parse a boolean.
|
static ConstraintType |
parseConstraintType(Number value)
Parse a constraint type.
|
static Double |
parseCurrency(Number value)
Parse currency.
|
static CurrencySymbolPosition |
parseCurrencySymbolPosition(String value)
Parse a currency symbol position value.
|
static void |
parseCustomField(ProjectFile file,
FieldContainer mpx,
String value,
FieldType mpxFieldID,
TimeUnit durationFormat)
Parse a custom field value.
|
static Boolean |
parseCustomFieldBoolean(String value)
Parse a custom field boolean value.
|
static Number |
parseCustomFieldCurrency(String value)
Parse a custom field currency value.
|
static LocalDateTime |
parseCustomFieldDate(String value)
Parse a custom field date value.
|
static Number |
parseCustomFieldNumber(String value)
Parse and custom field numeric value.
|
static LocalDateTime |
parseDateTime(String value)
Parse a date time value.
|
static DayOfWeek |
parseDay(Number value)
Parse a day.
|
static Duration |
parseDuration(ProjectFile file,
TimeUnit defaultUnits,
String value)
Parse a duration.
|
static Duration |
parseDurationInIntegerTenthsOfMinutes(String value)
Parse duration represented as an integer number of tenths of minutes.
|
static Duration |
parseDurationInTenthsOfMinutes(Number value)
Parse duration represented in tenths of minutes.
|
static Duration |
parseDurationInTenthsOfMinutes(ProjectProperties properties,
Number value,
TimeUnit targetTimeUnit)
Parse duration represented as tenths of minutes.
|
static Duration |
parseDurationInThousanthsOfMinutes(Number value)
Parse duration represented in thousandths of minutes.
|
static Duration |
parseDurationInThousanthsOfMinutes(ProjectProperties properties,
Number value,
TimeUnit targetTimeUnit)
Parse duration represented in thousandths of minutes.
|
static TimeUnit |
parseDurationTimeUnits(BigInteger value)
Parse duration time units.
|
static TimeUnit |
parseDurationTimeUnits(BigInteger value,
TimeUnit defaultValue)
Parse duration time units.
|
static EarnedValueMethod |
parseEarnedValueMethod(Number value)
Parse an earned value method.
|
static Object |
parseOutlineCodeValue(String value,
DataType type)
Parse an outline code/custom field value.
|
static LocalDateTime |
parseOutlineCodeValueDate(String value)
Read an outline code/custom field timestamp for a lookup table.
|
static Number |
parsePercentComplete(String value)
Parse percent complete values.
|
static Priority |
parsePriority(BigInteger priority)
Parse priority.
|
static Rate |
parseRate(BigDecimal originalValue,
TimeUnit targetUnits)
Parse rate.
|
static ResourceType |
parseResourceType(String value)
Parse a resource type.
|
static Integer |
parseResourceUID(String value)
Parse a resource UID.
|
static String |
parseString(String value)
Parse method for a string: returns the string unchanged.
|
static TaskType |
parseTaskType(String value)
Parse a task type.
|
static Integer |
parseTaskUID(String value)
Parse a task UID.
|
static LocalTime |
parseTime(String value)
Parse a time value.
|
static TimeUnit |
parseTimeUnit(Number value)
Parse time unit.
|
static Number |
parseUnits(Number value)
Parse units.
|
static UUID |
parseUUID(String value)
Convert the MSPDI representation of a UUID into a Java UUID instance.
|
static WorkContour |
parseWorkContour(String value)
Parse a work contour.
|
static WorkGroup |
parseWorkGroup(String value)
Parse a work group.
|
static TimeUnit |
parseWorkUnits(BigInteger value)
Parse work units.
|
static String |
printAccrueType(AccrueType value)
Print an accrue type.
|
static String |
printBookingType(BookingType value)
Print a booking type.
|
static String |
printBoolean(Boolean value)
Print a boolean.
|
static BigInteger |
printConstraintType(ConstraintType value)
Print a constraint type.
|
static BigDecimal |
printCurrency(Number value)
Print currency.
|
static BigDecimal |
printCurrencyMandatory(Number value)
Print currency.
|
static String |
printCurrencySymbolPosition(CurrencySymbolPosition value)
Prints a currency symbol position value.
|
static String |
printCustomField(MSPDIWriter writer,
Object value,
DataType type)
Print a custom field value.
|
static String |
printCustomFieldBoolean(Boolean value)
Print a custom field boolean value.
|
static String |
printCustomFieldCurrency(Number value)
Print a custom field currency value.
|
static String |
printCustomFieldDate(LocalDateTime value)
Print a custom field date value.
|
static String |
printCustomFieldNumber(Number value)
Print a custom field numeric value.
|
static String |
printDateTime(LocalDateTime value)
Print a date time value.
|
static BigInteger |
printDay(DayOfWeek day)
Print a day.
|
static String |
printDuration(MSPDIWriter writer,
Duration duration)
Print duration.
|
static BigDecimal |
printDurationInDecimalThousandthsOfMinutes(Duration duration)
Print duration in thousandths of minutes.
|
static BigInteger |
printDurationInIntegerTenthsOfMinutes(Duration duration)
Print duration in tenths of minutes.
|
static BigInteger |
printDurationInIntegerThousandthsOfMinutes(Duration duration)
Print duration in thousandths of minutes.
|
static String |
printDurationMandatory(MSPDIWriter writer,
Duration duration)
Print duration.
|
static BigInteger |
printDurationTimeUnits(Duration duration,
boolean estimated)
Print duration time units.
|
static BigInteger |
printDurationTimeUnits(TimeUnit value,
boolean estimated)
Print duration time units.
|
static BigInteger |
printEarnedValueMethod(EarnedValueMethod value)
Print an earned value method.
|
static String |
printOutlineCodeValue(Object value,
DataType type)
Write an outline code/custom field value for a lookup table.
|
static String |
printOutlineCodeValueDate(LocalDateTime value)
Write an outline code/custom field timestamp for a lookup table.
|
static BigInteger |
printOvertimeRateFormat(Resource resource,
Rate rate)
Print a time unit from a rate, and handle special case
for non-work resources.
|
static String |
printPercentComplete(Number value)
Print a percent complete value.
|
static BigInteger |
printPriority(Priority priority)
Print priority.
|
static BigDecimal |
printRate(Rate rate)
Print rate.
|
static BigDecimal |
printRateMandatory(Rate rate)
Print rate.
|
static String |
printResourceType(ResourceType value)
Print a resource type.
|
static String |
printResourceUID(Integer value)
Print a resource UID.
|
static BigInteger |
printStandardRateFormat(Resource resource,
Rate rate)
Print a time unit from a rate, and handle special case
for non-work resources.
|
static String |
printString(String value)
Print method for a string: returns the string unchanged.
|
static String |
printTaskType(TaskType value)
Print a task type.
|
static String |
printTaskUID(Integer value)
Print a task UID.
|
static String |
printTime(LocalTime value)
Print time.
|
static BigInteger |
printTimeUnit(Rate rate)
Print a time unit derived from a Rate.
|
static BigInteger |
printTimeUnit(TimeUnit value)
Print time unit.
|
static BigDecimal |
printUnits(Number value)
Print units.
|
static String |
printUUID(UUID guid)
Retrieve a UUID in the form required by MSPDI.
|
static String |
printWorkContour(WorkContour value)
Print a work contour.
|
static String |
printWorkGroup(WorkGroup value)
Print a work group.
|
static BigInteger |
printWorkUnits(TimeUnit value)
Print work units.
|
static void |
setContext(ProjectFile file,
boolean ignoreErrors)
This method is called to set the parent file to provide context for
parse and print operations.
|
public static final String printCustomFieldCurrency(Number value)
value
- currency valuepublic static final Number parseCustomFieldCurrency(String value)
value
- string representationpublic static final String printCustomFieldNumber(Number value)
value
- numeric valuepublic static final Number parseCustomFieldNumber(String value)
value
- string representationpublic static final String printCustomFieldBoolean(Boolean value)
value
- boolean valuepublic static final Boolean parseCustomFieldBoolean(String value)
value
- string representationpublic static final String printCustomFieldDate(LocalDateTime value)
value
- date valuepublic static final String printOutlineCodeValueDate(LocalDateTime value)
value
- Date valuepublic static final LocalDateTime parseOutlineCodeValueDate(String value)
value
- timestamp valuepublic static final LocalDateTime parseCustomFieldDate(String value)
value
- string representationpublic static final String printCustomField(MSPDIWriter writer, Object value, DataType type)
writer
- parent MSPDIWriter instancevalue
- attribute valuetype
- type of the value being passedpublic static final void parseCustomField(ProjectFile file, FieldContainer mpx, String value, FieldType mpxFieldID, TimeUnit durationFormat)
file
- parent filempx
- parent entityvalue
- string valuempxFieldID
- field IDdurationFormat
- duration format associated with the custom fieldpublic static final String printOutlineCodeValue(Object value, DataType type)
value
- value to writetype
- target typepublic static final Object parseOutlineCodeValue(String value, DataType type)
value
- string representation of valuetype
- target typepublic static final String printCurrencySymbolPosition(CurrencySymbolPosition value)
value
- CurrencySymbolPosition instancepublic static final CurrencySymbolPosition parseCurrencySymbolPosition(String value)
value
- currency symbol positionpublic static final String printAccrueType(AccrueType value)
value
- AccrueType instancepublic static final AccrueType parseAccrueType(String value)
value
- accrue type valuepublic static final String printResourceType(ResourceType value)
value
- ResourceType instancepublic static final ResourceType parseResourceType(String value)
value
- resource type valuepublic static final String printWorkGroup(WorkGroup value)
value
- WorkGroup instancepublic static final WorkGroup parseWorkGroup(String value)
value
- work group valuepublic static final String printWorkContour(WorkContour value)
value
- WorkContour instancepublic static final WorkContour parseWorkContour(String value)
value
- work contour valuepublic static final String printBookingType(BookingType value)
value
- BookingType instancepublic static final BookingType parseBookingType(String value)
value
- booking type valuepublic static final String printTaskType(TaskType value)
value
- TaskType instancepublic static final TaskType parseTaskType(String value)
value
- task type valuepublic static final BigInteger printEarnedValueMethod(EarnedValueMethod value)
value
- EarnedValueMethod instancepublic static final EarnedValueMethod parseEarnedValueMethod(Number value)
value
- earned value methodpublic static final BigDecimal printUnits(Number value)
value
- units valuepublic static final Number parseUnits(Number value)
value
- units valuepublic static final BigInteger printTimeUnit(TimeUnit value)
value
- TimeUnit instancepublic static final BigInteger printTimeUnit(Rate rate)
rate
- Rate instancepublic static final BigInteger printOvertimeRateFormat(Resource resource, Rate rate)
resource
- parent resourcerate
- Rate instancepublic static final BigInteger printStandardRateFormat(Resource resource, Rate rate)
resource
- parent resourcerate
- Rate instancepublic static final TimeUnit parseTimeUnit(Number value)
value
- time unit valuepublic static final String printTime(LocalTime value)
value
- time valuepublic static final TimeUnit parseWorkUnits(BigInteger value)
value
- work units valuepublic static final BigInteger printWorkUnits(TimeUnit value)
value
- TimeUnit instancepublic static final Duration parseDuration(ProjectFile file, TimeUnit defaultUnits, String value)
file
- parent filedefaultUnits
- default time units for the resulting durationvalue
- duration valuepublic static final String printDuration(MSPDIWriter writer, Duration duration)
writer
- parent MSPDIWriter instanceduration
- Duration valuepublic static final String printDurationMandatory(MSPDIWriter writer, Duration duration)
writer
- parent MSPDIWriter instanceduration
- Duration valuepublic static final BigInteger printDurationTimeUnits(Duration duration, boolean estimated)
duration
- Duration valueestimated
- is this an estimated durationpublic static final Double parseCurrency(Number value)
value
- currency valuepublic static final BigDecimal printCurrency(Number value)
value
- currency valuepublic static final BigDecimal printCurrencyMandatory(Number value)
value
- currency valuepublic static final TimeUnit parseDurationTimeUnits(BigInteger value)
value
- BigInteger valuepublic static final TimeUnit parseDurationTimeUnits(BigInteger value, TimeUnit defaultValue)
value
- BigInteger valuedefaultValue
- if value is null, use this value as the resultpublic static final BigInteger printDurationTimeUnits(TimeUnit value, boolean estimated)
value
- Duration unitsestimated
- is this an estimated durationpublic static final Priority parsePriority(BigInteger priority)
priority
- priority valuepublic static final BigInteger printPriority(Priority priority)
priority
- Priority instancepublic static final Duration parseDurationInThousanthsOfMinutes(Number value)
value
- duration valuepublic static final Duration parseDurationInTenthsOfMinutes(Number value)
value
- duration valuepublic static final Duration parseDurationInThousanthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit)
properties
- project propertiesvalue
- duration valuetargetTimeUnit
- required output time unitspublic static final Duration parseDurationInTenthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit)
properties
- project propertiesvalue
- duration valuetargetTimeUnit
- required output time unitspublic static final BigInteger printDurationInIntegerThousandthsOfMinutes(Duration duration)
duration
- Duration instancepublic static final BigDecimal printDurationInDecimalThousandthsOfMinutes(Duration duration)
duration
- Duration instancepublic static final BigInteger printDurationInIntegerTenthsOfMinutes(Duration duration)
duration
- Duration instancepublic static final Duration parseDurationInIntegerTenthsOfMinutes(String value)
value
- duration valuepublic static final UUID parseUUID(String value)
value
- MSPDI UUIDpublic static String printUUID(UUID guid)
guid
- UUID instancepublic static final BigDecimal printRate(Rate rate)
rate
- Rate instancepublic static final BigDecimal printRateMandatory(Rate rate)
rate
- Rate instancepublic static final Rate parseRate(BigDecimal originalValue, TimeUnit targetUnits)
originalValue
- rate valuetargetUnits
- target unitspublic static final BigInteger printDay(DayOfWeek day)
day
- Day instancepublic static final DayOfWeek parseDay(Number value)
value
- day valuepublic static final ConstraintType parseConstraintType(Number value)
value
- constraint type valuepublic static final BigInteger printConstraintType(ConstraintType value)
value
- ConstraintType instancepublic static final String printTaskUID(Integer value)
value
- task UIDpublic static final Integer parseTaskUID(String value)
value
- task UID stringpublic static final String printResourceUID(Integer value)
value
- resource UID valuepublic static final Integer parseResourceUID(String value)
value
- resource UID stringpublic static final String printBoolean(Boolean value)
value
- booleanpublic static final Boolean parseBoolean(String value)
value
- booleanpublic static final LocalTime parseTime(String value)
value
- time valuepublic static final String printDateTime(LocalDateTime value)
value
- date time valuepublic static final LocalDateTime parseDateTime(String value)
value
- string representationpublic static final String printString(String value)
value
- string valuepublic static final String parseString(String value)
value
- string valuepublic static final Number parsePercentComplete(String value)
value
- string valuepublic static final String printPercentComplete(Number value)
value
- numeric valuepublic static final void setContext(ProjectFile file, boolean ignoreErrors)
file
- parent file instanceignoreErrors
- ignore errors flagCopyright © 2000–2024 Packwood Software. All rights reserved.