public class AttMagic
extends Object
implements RemoteAccess, Externalizable
purpose: | handle all attribute related api tasks for new types, providing a simple interface (Map with attribute name/value pairs). it does not handle any ootb (modeled) attributes, though a custom subclass could implement this. | ||||||||||||||||||||
features: | Note: most functionality is available via commandline, call AttMagic without arguments for help.
| ||||||||||||||||||||
Enumeration information constants: |
| ||||||||||||||||||||
TODO: | explain enum mapping. | ||||||||||||||||||||
restrictions: | right now this class only deals with additional attributes, no ootb modeled atts are dealt with. composed/alias atts will be read on explicit request. |
find global atts (IBAS) defined for DefaultEPMDocument: String typeName="DefaultEPMDocument"; // without prefix crap! AttMagic.T t = AttMagic.getT(typeName); if (t == null) throw new WTException("type \"" + typeName + "\" not found."); Mapatts = t.getAttsInfo()[AttMagic.GLOBAL]; AttMagic.A a; for (String attName:atts.keySet()){ a=atts.get(attName); System.err.println("att "+attName+" is stored in "+a.getDbCol()+" type "+a.getDataType()); }
Modifier and Type | Class and Description |
---|---|
static class |
AttMagic.A
represents a LWCxxxAttDefinition
|
static class |
AttMagic.S |
static class |
AttMagic.T
T represents a LWCTypeDefinition
|
Modifier and Type | Field and Description |
---|---|
static int |
ALIAS |
static int |
CALCULATED |
static SimpleDateFormat |
DATE_WITH_TIME
default date/time format: yyyyMMdd HH:mm:ss
|
static String |
DECODE_DESCRIPTION |
static String |
DESCRIPTION_URL_DELIMITER |
static Object |
EDIT_IBAS |
static String |
ENUM_DESC_PREFIX |
static String |
ENUM_ENTRY_ACTIVE |
static String |
ENUM_ENTRY_DESC |
static String |
ENUM_ENTRY_DISPLAY |
static String |
ENUM_ENTRY_KEY |
static String |
ENUM_ENTRY_NAME |
static String |
ENUM_ENTRY_SORT |
static FastDateFormat |
FORMATTERT |
static int |
GLOBAL |
static String |
LOCK |
static int |
MAJOR |
static int |
MAP_SIZE |
static int |
MINOR |
static int |
MODELED |
static int |
MULTIVAL_ANY
return last (randomly) encountered value if multi value IBA detected
|
static int |
MULTIVAL_ERR
throw Exception if multi value IBA detected
|
static int |
MULTIVAL_LIST
if multi value IBA found, return values in List
|
static int |
MULTIVAL_SET
if multi value IBA found, return values in a Set
|
static String |
PRECISIONS |
static String |
RAW_ATTS |
static int |
STANDARD |
Constructor and Description |
---|
AttMagic()
simple constructor if data map and object to update are set later
|
AttMagic(AttMagic template)
initialize Attmagic from a template object (create a static one, set desired flag, from this construct new ones)
|
AttMagic(Object attHolder)
create AttMagic object for a persistable.
|
AttMagic(Object attHolder,
AttMagic template)
create AttMagic object for a persistable from a template AttMagic objects (thus allowing to preserve settings)
|
Modifier and Type | Method and Description |
---|---|
static Object |
_main(Class mec,
String[] args)
to invoke main in MS
|
void |
custPostRead(Persistable obid)
subclass can implement custom logic here
|
void |
custPostWrite(Persistable obid)
subclass can implement custom logic here
|
void |
custPreRead(Persistable obid)
subclass can implement custom logic here
|
void |
custPreWrite(Persistable attHolder2)
subclass can implement custom logic here
|
void |
custTypeChanged(Persistable obid)
subclass can implement custom logic here
|
static String |
decode(String in)
decode the encoded internal enum value into the real internal value - as returned by AttMagic getAtts
|
static String |
encode(String in)
encode a string for use as internal enum value: if it contains only acceptable values (in old 10 versions it could contain digits but not start with one) it is prefixed with 'x', else prefix is 'y' and the interal value is base64 encoded
|
static List<AttMagic.A> |
findAtt(String attRe)
deliver info about atts in type[s] passing a regex against the att name
|
static List<AttMagic.A> |
findAtt(String typeName,
String attRe)
deliver info about atts in type[s] passing a regex against the att name
|
static List<Persistable> |
findObjects(String type,
Map<String,String> where)
find objects of given type with criteria passed in a Map (where key=value ...)
|
Persistable |
forceAtts()
forcefully update atts - no checkout.
|
static void |
forcedCopyStdAtts(Object from,
Object to)
copy the standard attributes of one object to another - just sets the typeinfo object of the old to the new holder.
|
Object |
getAtt(String name)
return the value for attribute by name
|
static AttMagic.A |
getAtt(String type,
String att)
deliver info about the attribute in the type
|
Persistable |
getAttHolder()
see setter method.
|
static Map<String,String> |
getAttributesNames(Object typed)
deliver a map of global and standard attributes for given typed obj
|
Map<String,String> |
getAtts()
return the holder's attributes as strings
|
Map<String,String> |
getAtts(Persistable from)
read the attributes of an object, hiding the storage (standard att versus global (iba)) - just returns a map<String,String>
|
static Map<String,AttMagic.A>[] |
getAttsInfo(Object typed)
deliver info about the type's attributes, grouped by attribute type
|
static Map<String,AttMagic.A>[] |
getAttsInfo(String type)
deliver info about the type's attributes, grouped by attribute type
|
String |
getCheckinMessage()
see setter method.
|
String |
getCheckoutMessage()
see setter method.
|
FastDateFormat |
getDateFormat()
see setter method.
|
String |
getDefaultForMissingAtts()
see setter method.
|
static List<Map<String,String>> |
getEntryMaps(String enumName)
return for the global enumeration enumName a Map indexed with the enumeration entry keys and a Map as value holding name, other info and locale specific data:
|
static String |
getEnumDescriptionValue(String enumName,
String entryName)
return the default description value of an enumeration entry
|
static String |
getEnumDescriptionValue(String enumName,
String entryName,
Locale locale)
return the localized description value of an enumeration entry, tries language_country, language, default description
|
static String |
getEnumDescriptionValue(String enumName,
String entryName,
String[] locale)
return the first localized description value of an enumeration entry from the list passed in locale
|
static String |
getEnumDisplayValue(String enumName,
String entryName)
return the default display value of an enumeration entry
|
static String |
getEnumDisplayValue(String enumName,
String entryName,
Locale locale)
return the localized display value of an enumeration entry, tries language_country, language, default display
|
static String |
getEnumDisplayValue(String enumName,
String entryName,
String[] locale)
return the first localized display value of an enumeration entry from the list passed in locale
|
static Map<String,String> |
getEnumEntryMap(String enumName,
String entryName)
return infos about an entry in a global enum, @see getEntryMaps
|
static boolean |
getEnumValueSelectable(String enumName,
String entryName)
tell if an enumeration entry is selectable
|
static Map<String,Method> |
getGetters(Class cls)
return a Map with ptcXXX key/Method values for a given class
|
int |
getMultiValBehavior()
see setter method.
|
String |
getNewTypeName()
see setter method.
|
Map<String,Object> |
getRawAtts()
return the holder's attributes as java objects.
as a side effect populates the Map precisions with the precision value[s] of the real/unit values read from the database. |
Map<String,Object> |
getRawAtts(Persistable from)
return the persistable's attributes as java objects.
as a side effect populates the Map precisions with the precision value[s] of the real/unit values read from the database. |
Map<String,Object> |
getRawAtts(Persistable from,
boolean addPrecision)
return the persistable's attributes as java objects., optionally also retrieve the precisions to use
after the call the proteced Map precisions with the precision value[s] of the real/unit values read from the database is populated. |
static List<String[]> |
getSortedEnumDisplayValues(String enumName,
boolean selOnly)
return the default display values of an enumeration
|
static List<String[]> |
getSortedEnumDisplayValues(String enumName,
boolean selOnly,
Locale locale)
return the localized display value of an enumeration entry, tries language_country, language, default display
|
static List<String[]> |
getSortedEnumDisplayValues(String enumName,
boolean selOnly,
String[] locale)
return the first localized display value of an enumeration entry from the list passed in locale
|
static List<AttMagic.T> |
getT()
return a List of all type info objects (T)
|
static AttMagic.T |
getT(String typeName) |
String |
getTypeName()
the attHolder's type.
|
static Set<String> |
getTypeNames()
return a list of all type names
|
static Map<String,AttMagic.T> |
getTypes() |
boolean |
hasDelta(Map<String,Object> toBe)
return true if holder's atts differ from the ones in the toBe Map.
|
boolean |
hasDelta(Map<String,Object> toBe,
Set ignore) |
static boolean |
hasReadableAtt(Persistable typed,
String att)
determines if typed objects type has a readable attribute with given name
|
boolean |
hasReadableAtt(String att)
determines if AttMagic's holder has a readable attribute with given name
|
static boolean |
hasReadableAtt(String type,
String att)
determines if type has a readable attribute with given name
|
static boolean |
hasWriteableAtt(Persistable typed,
String att)
determines if the typed object's type has a writable attribute with given name
|
boolean |
hasWriteableAtt(String att)
determines if AttMagic's holder has a writable attribute with given name
|
static boolean |
hasWriteableAtt(String type,
String att)
determines if the type has a writable attribute with given name
|
boolean |
isAddAdhocIBAs()
see setter method.
|
boolean |
isAddAlias()
see setter method.
|
boolean |
isAddCalculated()
see setter method.
|
boolean |
isAddMasterAtts()
see setter method.
|
boolean |
isAddValues()
see setter method.
|
boolean |
isClearMissing() |
boolean |
isCreateEmpty()
see setter method.
|
static boolean |
isEnumEncoded(String enumName)
tell if enum has encoded internal values (must have the string AttMagic decode in it's description
|
boolean |
isForceCSM()
see setter method.
|
boolean |
isForcedUpdate()
see setter method.
|
boolean |
isForceFT()
see setter method.
|
boolean |
isIterate()
see setter method.
|
boolean |
isKeepCheckedOut()
see setter method.
|
boolean |
isMasterAttsOverride()
see setter method.
|
boolean |
isRefresh()
see setter method.
|
boolean |
isRemove()
see setter method.
|
boolean |
isUpdateToEmpty()
see setter method.
|
boolean |
isValidate()
see setter method.
|
boolean |
isWithMeta()
see setter method.
|
boolean |
isWithUnits()
see setter method.
|
static void |
main(String[] a)
print program usage info or invoke test cases
|
Map<String,Object> |
queryObject()
run query-objects against the internal object and return the Map with results for standard/global attributes, plus alias and/or calculated if requested by setup
|
Map<String,Object> |
queryObject(Object from)
run query-objects against object and return the Map with results for standard/global attributes, plus alias and/or calculated if requested by setup
|
Map<String,Object> |
queryObject(Object from,
boolean onlyRO)
run query-objects against object and return the Map with results for standard/global attributes, plus alias and/or calculated if requested by setup
|
Map<String,Object> |
queryObject(Object from,
boolean onlyRO,
boolean addModeled)
run query-objects against object and return the Map with results for standard/global attributes, plus alias and/or calculated if requested by setup
|
void |
readExternal(ObjectInput objectinput)
deserialization.
|
AttMagic |
set(Map moreVals)
add key/values to data map (assumes keys are Strings!)
|
AttMagic |
set(String key,
Object value)
add a key/value pair to the data Map - overrides existing key/values
|
AttMagic |
setAddAdhocIBAs(boolean addAdhocIBAs)
flag if AdHoc IBAs should be read/written (default = false)
|
AttMagic |
setAddAlias(boolean addAlias)
flag to tell if the result Map should also contain alias atts - default=false
|
AttMagic |
setAddCalculated(boolean addCalculated)
flag to tell if the result Map should also contain calculated atts - default=false
|
AttMagic |
setAddMasterAtts(boolean addMasterAtts)
flag if the attributes of the Master (if attHolder is RevisionControlled) should be added to result Map
|
AttMagic |
setAddValues(boolean addValues)
flag to make AttMagic add IBAs without deleting existing values (creates multivalue) default=false
|
AttMagic |
setAttHolder(Object attHolder)
set the Persistable to read/write atts from - can be an OBID or ObjectRef too.
|
AttMagic |
setCheckinMessage(String checkinMessage)
override default AttMagic checkin message
|
AttMagic |
setCheckoutMessage(String checkoutMessage)
override default AttMagic checkout message
|
AttMagic |
setClearMissing(boolean clear)
should AttMagic clear existing values not passed in map? default=false Note: this only works with forcedUpdate=true
|
AttMagic |
setCreateEmpty(boolean createEmpty)
should AttMagic create empty IBA values? default=false
|
AttMagic |
setData(Map<String,Object> values)
set a new data Map NOTE: AttMagic stores a copy of the Map, so first fill it, then call this method!
|
AttMagic |
setDateFormat(FastDateFormat dateFormat)
set new date format for date parsing
|
AttMagic |
setDateFormat(String dateFormat)
set new date format for date parsing
|
AttMagic |
setDefaultForMissingAtts(String defaultForMissingAtts)
if set this value will be put in the result map for missing attributes
|
AttMagic |
setForceCSM(boolean isCSM)
flag to set if classification nodes need to be written (default = false)
|
AttMagic |
setForcedUpdate(boolean forcedUpdate)
flag if update must happen without check-out - default=false
|
AttMagic |
setForcedUpdate(boolean forcedUpdate,
boolean iterate)
flag if forced update must happen - if iterate=true run forced update on a newly created iteration (same as setForcedUpdate(true).setIterate(true) )
|
AttMagic |
setForceFT(boolean isFT)
flag to set if family table epmdocs need to be written (default = false)
|
AttMagic |
setIterate(boolean iterate)
flag to tell if the object should be iterated before forced update (=iterate but override constraints)
|
AttMagic |
setKeepCheckedOut(boolean keepCheckedOut)
flag to kepp the attHolder checked-out if AttMagic checked it out for update.
|
AttMagic |
setMasterAttsOverride(boolean masterAttsOverride)
if master adds are added to the map, should they override the iteration's values? default=false;
|
AttMagic |
setMultiValBehavior(int multiValBehavior)
configure what to do if multivalue IBA found:
MULTIVAL_ERR throws an Exception
MULTIVAL_ANY returns the last value seen
MULTIVAL_LIST returns a List object with the values in it
MULTIVAL_SET returns a Set with the values in it
default=MULTIVAL_ERR.
|
AttMagic |
setNewTypeName(String newTypeName)
if set will re-type the attHolder to a different type.
|
AttMagic |
setQueryAtts(Set<String> attNamesSet)
set a new asked-for atts set
NOTE: AttMagic stores a copy of the Set, so first fill it, then call this method! |
AttMagic |
setRefresh(boolean noRefresh)
flag to tell if the attHolder is an IBAHolder, should it be refreshed before reading the IBAs? default=true
|
AttMagic |
setRemove(boolean remove)
flag if the written values should be removed from the (copied) map - set to false to call same AttMagic for more than one Object
|
AttMagic |
setType()
retype the holder with the newTypeName type
|
AttMagic |
setUpdateToEmpty(boolean updateToEmpty)
flag to tell update to an empty value should delete the xxxvalue (default=false, consistent with old/UpdateIBAs behaviour) if set to true will update existing iba values to empty rather than delete
|
AttMagic |
setValidate(boolean validate)
flag to force a constraint check even for forced update (not yet implemented) - default=false
|
AttMagic |
setWithMeta(boolean withMeta)
flag if atts returned must contain meta inforamtion about the atts themselves (not yet implemented)
|
AttMagic |
setWithUnits(boolean withUnits)
flag if the result of a float-with-unit should contain the unit too (default=true)
|
static String |
shortTypeName(Object typed)
returns the shortened type name (without the reversed internet domain)
|
static Map |
startup(Map in)
allows PremiumService to initialize AttMagic
|
static String |
TNWRID(String type)
return the type name with the reversed Site internet domain or java package, but without parent[s] info (wt.part.WTPart / WTPart)
|
String |
toString()
gets more verbose depending on log4j log level (DEBUG shows settings, TRACE shows initial data map)
|
static Map |
typeChanged(Map in)
allows PremiumService to notify AttMagic about type setup changes
|
static String |
typeName(Object typed)
returns the type name
|
Persistable |
update()
set the attHolder's attributes to the values in the internal new-values Map, hiding the storage (standard att versus global (iba))
|
Persistable |
update(Map<String,Object> values)
set the attHolder's attributes for the keys passed in the values Map, hiding the storage (standard att versus global (iba))
|
void |
updateIBAs(Map<String,Object> ibas)
update the IBAs of obj
|
void |
writeExternal(ObjectOutput objectoutput)
serialization
|
public static final int MAJOR
public static final int MINOR
public static final String LOCK
public static final Object EDIT_IBAS
public static final int MULTIVAL_ERR
public static final int MULTIVAL_ANY
public static final int MULTIVAL_LIST
public static final int MULTIVAL_SET
public static SimpleDateFormat DATE_WITH_TIME
public static final int ALIAS
public static final int MODELED
public static final int GLOBAL
public static final int STANDARD
public static final int CALCULATED
public static final int MAP_SIZE
public static final String ENUM_ENTRY_NAME
public static final String ENUM_ENTRY_DISPLAY
public static final String ENUM_DESC_PREFIX
public static final String ENUM_ENTRY_DESC
public static final String ENUM_ENTRY_ACTIVE
public static final String ENUM_ENTRY_SORT
public static final String ENUM_ENTRY_KEY
public static final String PRECISIONS
public static final String RAW_ATTS
public static final String DECODE_DESCRIPTION
public static final String DESCRIPTION_URL_DELIMITER
public static FastDateFormat FORMATTERT
public AttMagic()
public AttMagic(Object attHolder) throws WTException
attHolder
- persistable to read/write atts fromWTException
public AttMagic(AttMagic template) throws WTException
template
- WTException
public AttMagic(Object attHolder, AttMagic template) throws WTException
attHolder
- persistable to read/write atts fromtemplate
- AttMagic object to copy settings fromWTException
public String toString()
toString
in class Object
public Persistable getAttHolder()
public AttMagic setAttHolder(Object attHolder)
attHolder
- obj to read/writepublic String getDefaultForMissingAtts()
public AttMagic setDefaultForMissingAtts(String defaultForMissingAtts)
defaultForMissingAtts
- a string to use as defaultpublic boolean isRemove()
public AttMagic setRemove(boolean remove)
remove
- new value for flagpublic boolean isWithUnits()
public AttMagic setWithUnits(boolean withUnits)
withUnits
- new value for flagpublic int getMultiValBehavior()
public AttMagic setMultiValBehavior(int multiValBehavior)
multiValBehavior
- the new valuepublic boolean isMasterAttsOverride()
public AttMagic setMasterAttsOverride(boolean masterAttsOverride)
masterAttsOverride
- new value for flagpublic boolean isRefresh()
public AttMagic setRefresh(boolean noRefresh)
noRefresh
- the new value for flagpublic boolean isAddCalculated()
public AttMagic setAddCalculated(boolean addCalculated)
addCalculated
- the new value for flagpublic boolean isIterate()
public AttMagic setIterate(boolean iterate)
iterate
- the new value for flagpublic boolean isAddAlias()
public AttMagic setAddAlias(boolean addAlias)
addAlias
- the new value for flagpublic boolean isUpdateToEmpty()
public AttMagic setUpdateToEmpty(boolean updateToEmpty)
addAlias
- the new value for flagpublic AttMagic setData(Map<String,Object> values)
values
- the new Map to usepublic AttMagic setQueryAtts(Set<String> attNamesSet)
values
- the new Set to usepublic AttMagic set(String key, Object value)
key
- new keyvalue
- new valuepublic AttMagic set(Map moreVals)
moreVals
- public boolean isKeepCheckedOut()
public AttMagic setKeepCheckedOut(boolean keepCheckedOut)
keepCheckedOut
- the new value for flagpublic boolean isValidate()
public AttMagic setValidate(boolean validate)
validate
- the new value for flagpublic String getCheckinMessage()
public AttMagic setCheckinMessage(String checkinMessage)
checkinMessage
- the message to usepublic String getCheckoutMessage()
public AttMagic setCheckoutMessage(String checkoutMessage)
checkoutMessage
- the message to usepublic boolean isAddValues()
public AttMagic setAddValues(boolean addValues)
addValues
- the new value for flagpublic boolean isCreateEmpty()
public AttMagic setClearMissing(boolean clear)
clear
- public boolean isClearMissing()
public AttMagic setCreateEmpty(boolean createEmpty)
createEmpty
- public boolean isForcedUpdate()
public AttMagic setForcedUpdate(boolean forcedUpdate)
forcedUpdate
- the new value for flagpublic AttMagic setForcedUpdate(boolean forcedUpdate, boolean iterate)
forcedUpdate
- the new value for forcedUpdate flagiterate
- the new value for iterate flagpublic boolean isWithMeta()
public AttMagic setWithMeta(boolean withMeta)
withMeta
- the new value for flagpublic boolean isAddMasterAtts()
public AttMagic setAddMasterAtts(boolean addMasterAtts)
addMasterAtts
- the new value for flagpublic boolean isAddAdhocIBAs()
public boolean isForceCSM()
public boolean isForceFT()
public AttMagic setAddAdhocIBAs(boolean addAdhocIBAs)
addAdhocIBAs
- the new value for flagpublic AttMagic setForceCSM(boolean isCSM)
addAdhocIBAs
- the new value for flagpublic AttMagic setForceFT(boolean isFT)
addAdhocIBAs
- the new value for flagpublic FastDateFormat getDateFormat()
public AttMagic setDateFormat(String dateFormat)
dateFormat
- new format string, see java.text.SimpleDateFormatpublic AttMagic setDateFormat(FastDateFormat dateFormat)
dateFormat
- new SimpleDateFormat to usepublic String getTypeName()
public String getNewTypeName()
public AttMagic setNewTypeName(String newTypeName) throws WTException
newTypeName
- last part of type name including reversed internet domain (e.g. WCTYPE|wt.part.WTPart|de.sulis.SulisPart)WTException
public static void main(String[] a) throws Exception
a
- commandline argsException
public static String encode(String in) throws WTException
in
- the true internal value - as passed to AttMagic setAttsWTException
public static String decode(String in) throws WTException
in
- the internal enum valueWTException
public static List<String[]> getSortedEnumDisplayValues(String enumName, boolean selOnly) throws WTException
enumName
- the internal global enumeration nameselOnly
- true to return only enabled entriesWTException
- if enum not foundpublic static List<String[]> getSortedEnumDisplayValues(String enumName, boolean selOnly, Locale locale) throws WTException
enumName
- the internal global enumeration nameselOnly
- true to return only enabled entrieslocale
- name of locale (e.g., en_US, de)WTException
- if enum not foundpublic static List<String[]> getSortedEnumDisplayValues(String enumName, boolean selOnly, String[] locale) throws WTException
enumName
- the internal global enumeration nameselOnly
- true to return only enabled entrieslocale
- names of locales to test (e.g., en_US, en, ENUM_ENTRY_DISPLAY)WTException
- if no entry found or no display value existspublic static String getEnumDisplayValue(String enumName, String entryName) throws WTException
enumName
- the internal global enumeration nameentryName
- the internal name of the keyWTException
- if enum or key not found or no display value existspublic static String getEnumDisplayValue(String enumName, String entryName, Locale locale) throws WTException
enumName
- the internal global enumeration nameentryName
- the internal name of the keylocale
- name of locale (e.g., en_US, de)WTException
- if enum or key not found or no display value existspublic static Map<String,String> getEnumEntryMap(String enumName, String entryName) throws WTException
enumName
- internal name of global enumentryName
- internal name of enum entry to find infos forWTException
public static String getEnumDisplayValue(String enumName, String entryName, String[] locale) throws WTException
enumName
- the internal global enumeration nameentryName
- the internal name of the keylocale
- names of locales to test (e.g., en_US, en, ENUM_ENTRY_DISPLAY)WTException
- if no entry found or no display value existspublic static boolean getEnumValueSelectable(String enumName, String entryName) throws WTException
enumName
- the internal global enumeration nameentryName
- the internal name of the keyWTException
- if no entry found or no display value existspublic static String getEnumDescriptionValue(String enumName, String entryName) throws WTException
enumName
- the internal global enumeration nameentryName
- the internal name of the keyWTException
- if enum or key not foundpublic static String getEnumDescriptionValue(String enumName, String entryName, Locale locale) throws WTException
enumName
- the internal global enumeration nameentryName
- the internal name of the keylocale
- name of locale (e.g., en_US, de)WTException
- if enum or key not foundpublic static String getEnumDescriptionValue(String enumName, String entryName, String[] locale) throws WTException
enumName
- the internal global enumeration nameentryName
- the internal name of the keylocale
- names of locales to test (e.g., en_US, en, ENUM_ENTRY_DISPLAY)WTException
- if no entry found or no description value existspublic static boolean isEnumEncoded(String enumName) throws WTException
enumName
- WTException
public static List<Map<String,String>> getEntryMaps(String enumName) throws WTException
enumName
- the internal name of the enumerationWTException
- if enum not found.public static Object _main(Class mec, String[] args) throws Exception
mec
- class of AttMagic (may be subclassed)args
- String[] passed from main() callWTException
Exception
public Object getAtt(String name) throws WTException
name
- WTException
public void custPreRead(Persistable obid) throws WTException
obid
- the attribute holderWTException
public void custTypeChanged(Persistable obid) throws WTException
obid
- the attribute holderWTException
public void custPostRead(Persistable obid) throws WTException
obid
- the attribute holderWTException
public void custPreWrite(Persistable attHolder2) throws WTException
obid
- the attribute holderWTException
public void custPostWrite(Persistable obid) throws WTException
obid
- the attribute holderWTException
public Map<String,String> getAtts() throws WTException
WTException
public Map<String,String> getAtts(Persistable from) throws WTException
from
- object to fetch atts fromWTException
public Map<String,Object> getRawAtts() throws WTException
WTException
public Map<String,Object> getRawAtts(Persistable from) throws WTException
from
- WTException
public Map<String,Object> getRawAtts(Persistable from, boolean addPrecision) throws WTException
from
- addPrecision
- flag if we also want precision informationWTException
public static Map<String,Method> getGetters(Class cls)
cls
- public static String typeName(Object typed) throws WTException
typed
- the input object to testWTException
public static String shortTypeName(Object typed) throws WTException
typed
- the input object to testWTException
public static Map<String,String> getAttributesNames(Object typed) throws WTException
WTException
public static Map<String,AttMagic.A>[] getAttsInfo(Object typed) throws WTException
WTException
public static Map<String,AttMagic.A>[] getAttsInfo(String type) throws WTException
WTException
public static AttMagic.A getAtt(String type, String att) throws WTException
WTException
public static List<AttMagic.A> findAtt(String attRe) throws WTException
WTException
public static AttMagic.T getT(String typeName) throws WTException
WTException
public static List<AttMagic.T> getT() throws WTException
WTException
public static List<AttMagic.A> findAtt(String typeName, String attRe) throws WTException
WTException
public AttMagic setType() throws WTException
WTException
public Persistable update(Map<String,Object> values) throws WTException
values
- a map with new values to setWTException
public Persistable update() throws WTException
WTException
public static void forcedCopyStdAtts(Object from, Object to) throws Exception
from
- to
- Exception
public Persistable forceAtts() throws WTException
WTException
public void updateIBAs(Map<String,Object> ibas) throws WTException
ibas
- WTException
public static boolean hasWriteableAtt(String type, String att) throws WTException
type
- name of (soft)type to testatt
- name of att to checkWTException
public boolean hasReadableAtt(String att) throws WTException
att
- name of att to checkWTException
public static boolean hasReadableAtt(Persistable typed, String att) throws WTException
typed
- Persistable to testatt
- name of att to checkWTException
public boolean hasWriteableAtt(String att) throws WTException
att
- name of att to checkWTException
public static boolean hasWriteableAtt(Persistable typed, String att) throws WTException
typed
- Persistable to testatt
- name of att to checkWTException
public static boolean hasReadableAtt(String type, String att) throws WTException
type
- att
- WTException
public static String TNWRID(String type) throws WTException
type
- WTException
public static Map typeChanged(Map in)
in
- Map with eventpublic static Map startup(Map in) throws Exception
in
- Map with eventException
public boolean hasDelta(Map<String,Object> toBe) throws WTException
toBe
- atts we need.WTException
public boolean hasDelta(Map<String,Object> toBe, Set ignore) throws WTException
toBe
- atts we need.ignore
- Set with attribute names to ignoreWTException
public Map<String,Object> queryObject() throws WTException
WTException
public Map<String,Object> queryObject(Object from) throws WTException
from
- obj to get atts forWTException
public Map<String,Object> queryObject(Object from, boolean onlyRO) throws WTException
from
- obj to get atts foronlyRO
- flag whether we only want alias and calculated attsWTException
public Map<String,Object> queryObject(Object from, boolean onlyRO, boolean addModeled) throws WTException
from
- obj to get atts foronlyRO
- flag whether we only want alias and calculated attsaddModeled
- flag if we also want modeled attsWTException
public static List<Persistable> findObjects(String type, Map<String,String> where) throws WTException
type
- where
- WTException
public static Set<String> getTypeNames() throws WTException
WTException
public static Map<String,AttMagic.T> getTypes() throws WTException
WTException
public void readExternal(ObjectInput objectinput) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput objectoutput) throws IOException
writeExternal
in interface Externalizable
IOException