public class LoaderUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ProgressLogger |
_logger |
protected ModelLoaderOptions |
_options |
Constructor and Description |
---|
LoaderUtils(ModelProcessIntf loader) |
Modifier and Type | Method and Description |
---|---|
protected void |
addCurrencyCode(java.util.Currency currency) |
protected boolean |
addUnitOfMeasure(java.lang.String unit,
java.lang.String abreviation,
java.lang.String description,
java.lang.String siteId) |
static java.lang.String |
arrayToCommaString(java.lang.String[] values) |
protected boolean |
doUpdate(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item) |
java.text.NumberFormat |
getFormater() |
ModelProcessIntf |
getLoader() |
int |
getUnitFieldLength() |
int |
getUpdateMode() |
static boolean |
isNotInternetEmail(java.lang.String value)
Quick heuristic to filter out values that are not Internet email addresses
Not guaranteed to filter all bad addresses, but won't eliminate any good ones
|
boolean |
isValidDomainName(java.lang.String name)
Validates that a domain name conforms to the widely accepted TLD format.
|
boolean |
isValidEmail(java.lang.String address) |
void |
logException(Page page,
ItemBase item,
java.lang.Throwable t) |
static java.lang.String |
messageFromException(java.lang.Throwable t) |
boolean |
setDateValue(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item) |
void |
setDescriptionValue(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item)
Sets an optional description field on any Mbo with check for null, logic for exception
handling, and warning message on failure.
|
boolean |
setDurationValue(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item) |
protected void |
setFloatValue(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item)
Sets an optional float value on any Mbo with check for null, that it is a valid
integer, exception handling, and warning message on failure
|
protected void |
setIntValue(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item)
Sets an optional integer value on any Mbo with check for null, that it is a valid
integer, exception handling, and warning message on failure
|
protected void |
setMeasurmentValue(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item)
Sets an optional measurement value on any Mbo with check for null, that it is a valid.
|
protected void |
setReference(MboRemote mbo,
java.lang.String attribute,
java.lang.String value)
Sets a reference between Mbos.
|
protected void |
setReference(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
long flags)
Sets a reference between Mbos.
|
protected void |
setString(MboRemote mbo,
java.lang.String attribute,
java.lang.String value)
Sets a string value that is not directly from a COBie item class or that the
calling code needs to trap exceptions for
|
protected boolean |
setStringValue(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item)
Sets a string value that is not directly from a COBie item class or that the
calling code needs to trap exceptions for
|
void |
setTimestamp(MboRemote mbo,
java.lang.String attribute,
ItemBase item) |
boolean |
setUnitValue(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item) |
boolean |
setUnitValue(MboRemote mbo,
java.lang.String attribute,
java.lang.String value,
ItemBase item,
boolean logError)
Sets an Mbo unit of measure value.
|
static boolean |
valueHasContent(java.lang.String value) |
protected ModelLoaderOptions _options
protected ProgressLogger _logger
public LoaderUtils(ModelProcessIntf loader)
public int getUpdateMode()
public ModelProcessIntf getLoader()
public java.text.NumberFormat getFormater()
public int getUnitFieldLength()
protected void addCurrencyCode(java.util.Currency currency) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
protected boolean addUnitOfMeasure(java.lang.String unit, java.lang.String abreviation, java.lang.String description, java.lang.String siteId)
protected boolean doUpdate(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
public boolean isValidDomainName(java.lang.String name)
Note: The formal definition of allowable domain names is much looser. This method uses the stricter definition in common practice for registered domains
name
- public boolean isValidEmail(java.lang.String address)
public boolean setDateValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
public void setDescriptionValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
mbo
- Target Mboattribute
- Attribute namevalue
- New value for fielditem
- The item that was the source of the value, Used for error reportingpublic boolean setDurationValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
protected void setFloatValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
mbo
- Target Mboattribute
- Attribute namevalue
- New value for fieldprotected void setIntValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
mbo
- Target Mboattribute
- Attribute namevalue
- New value for fieldprotected void setMeasurmentValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
mbo
- Target Mboattribute
- Attribute namevalue
- New value for fieldprotected void setReference(MboRemote mbo, java.lang.String attribute, java.lang.String value) throws java.rmi.RemoteException, MXException
mbo
- Target Mboattribute
- Attribute namevalue
- New value for fieldjava.rmi.RemoteException
MXException
protected void setReference(MboRemote mbo, java.lang.String attribute, java.lang.String value, long flags) throws java.rmi.RemoteException, MXException
mbo
- Target Mboattribute
- Attribute namevalue
- New value for fieldjava.rmi.RemoteException
MXException
protected void setString(MboRemote mbo, java.lang.String attribute, java.lang.String value) throws java.rmi.RemoteException, MXException
mbo
- Target Mboattribute
- Attribute namevalue
- New value for fieldMXException
java.rmi.RemoteException
protected boolean setStringValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
mbo
- Target Mboattribute
- Attribute namevalue
- New value for fieldpublic boolean setUnitValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
public boolean setUnitValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item, boolean logError)
mbo
- attribute
- value
- item
- logError
- public static java.lang.String arrayToCommaString(java.lang.String[] values)
public static boolean isNotInternetEmail(java.lang.String value)
value
- public static java.lang.String messageFromException(java.lang.Throwable t)
public static boolean valueHasContent(java.lang.String value)