public class AttributeImpl extends java.lang.Object implements Attribute
Modifier and Type | Class and Description |
---|---|
protected class |
AttributeImpl.OtherFields |
static class |
BaseObject.ChildAlreadyExists |
protected static interface |
BaseObject.Manager |
protected static class |
BaseObject.Matcher |
protected static class |
BaseObject.STATE |
protected static class |
BaseObject.UnsupportedRestOperationException |
ADDL_LIST_DISPLAY_FIELDS, ADDL_LIST_SEARCH_FIELDS, API_NAME, BODY, CHILD_LOOKUP_CODES, DATA_FILTERS, DATETIME_DISPLAY_TYPE, DECIMAL_PLACES, DEFAULT_VALUE, DEFINITION, DEPENDENCY_FIELDS, DESCRIPTION, DISPLAY_HEIGHT, DISPLAY_LABEL, DISPLAY_LABEL_PLURAL, DISPLAY_SEQUENCE, DISPLAY_WIDTH, ENABLED, END_DATE_ACTIVE, ERROR_MESSAGE, EXAMPLE, EXPRESSION, FIELDS, FORMULA_TYPE, FULL_NAME, FUNCTION_ID, FUNCTIONS, GLOBAL_FUNCTIONS, HELP_TEXT, ID, INDEXED, IS_CUSTOM, IS_MULTISELECT_PICKLIST, LIST_DISPLAY_FIELD, LIST_OBJECT, LOOKUP_CODE, LOOKUP_TYPE, LOOKUP_TYPES, LOOKUPS, MATCH_CASE, MAX_LENGTH, MAX_VALUE, MEANING, MIN_LENGTH, MIN_VALUE, NAME, OBJECTS, OPERATOR, PARAMETERS, PARENT_BUSINESS_OBJECT, PARENT_LOOKUP_CODE, PARENT_PICKLIST, PICKLIST_LOOKUP_TYPE, PRIVILEGE, PUBLISHED_AS_REST, RECORD_NAME_LABEL, REQUIRED, REQUIRED_EXPRESSION, RETURN_TYPE, SEARCH_FIELD_API_NAME, SORT_BY, SORT_BY_ASCENDING, START_DATE_ACTIVE, TRIGGERS, TYPE, UPDATABLE, UPDATABLE_EXPRESSION, VALIDATORS, VALUE_MAP, VALUE1, VALUE2, VISIBILITY_PROPERTY
Constructor and Description |
---|
AttributeImpl(BusinessObjectImpl owner,
org.codehaus.jettison.json.JSONObject attr) |
Modifier and Type | Method and Description |
---|---|
void |
addDependencyAttr(Attribute attr)
Adds an attribute as dependency attribute, whose data changes will cause
this attribute's constraint expression to be reevaluated.
|
void |
addOtherAttr(Attribute attr,
java.lang.String relation) |
protected org.codehaus.jettison.json.JSONObject |
convertToJSON(java.lang.Object... attrNameAndValues) |
protected <T> T |
createChild(java.lang.String accessorName,
java.lang.Class<T> type,
org.codehaus.jettison.json.JSONObject obj) |
AttributeTrigger |
createTrigger(java.lang.String name,
java.lang.String triggerDefinition)
Creates a trigger for this attribute.
|
AttributeTrigger |
createTrigger(java.lang.String name,
java.lang.String triggerDefinition,
java.lang.String errorMessage)
Creates a trigger for this attribute.
|
AttributeValidator |
createValidator(java.lang.String name,
java.lang.String ruleDefinition,
java.lang.String errorMessage)
Creates a validator for this attribute.
|
protected void |
deleteChild(BaseObject.Matcher matcher) |
protected void |
deleteChild(java.lang.String accessorName,
java.lang.String childName) |
void |
deleteTrigger(AttributeTrigger trigger)
Deletes a trigger from this attribute.
|
void |
deleteValidator(AttributeValidator validator)
Deletes a validator from this attribute.
|
void |
doCreateNewChildren() |
void |
doDeleteChildren() |
void |
doSetAttributes() |
boolean |
equals(java.lang.Object obj) |
protected <T> T |
findChild(java.lang.Class<T> type,
BaseObject.Matcher matcher) |
protected <T> T |
findChild(java.lang.String accessorName,
java.lang.String childName,
java.lang.Class<T> type) |
protected <T> java.util.List<T> |
findChildren(java.lang.Class<T> type,
BaseObject.Matcher matcher)
Find all children objects matching the given Matcher.
|
AttributeTrigger |
findTrigger(java.lang.String name)
Retrieve the trigger of the given name.
|
AttributeValidator |
findValidator(java.lang.String name)
Retrieve the validator of the given name.
|
protected java.lang.String |
getAccessorNameFromOwner()
Get the resource name that is used by the owner to access this type of object.
|
protected java.lang.Object |
getAttribute(java.lang.String attrName) |
protected java.lang.Object |
getAttribute(java.lang.String attrName,
java.lang.Object defaultValue)
Get the attribute value for the given attribute name.
|
BusinessObject |
getBusinessObject()
Returns the business object that owns the attribute
|
protected <T> java.util.Collection<T> |
getChildren(java.lang.String accessorName,
java.lang.Class<T> type) |
protected java.util.List<oracle.adfinternal.businesseditor.restapi.BaseObject> |
getChildrenDeleted(BaseObject.Matcher childMatcher) |
protected org.codehaus.jettison.json.JSONArray |
getChildrenJSON(java.lang.String accessorName)
Get all children of a given type defined by accessorName.
|
protected java.util.List<oracle.adfinternal.businesseditor.restapi.BaseObject> |
getChildrenNew(BaseObject.Matcher childMatcher) |
java.util.Map<java.lang.String,java.lang.String> |
getCustomProperties(java.lang.String namespace)
Return a map of custom properties for the attribute with the given namespace
|
java.lang.String |
getCustomProperty(java.lang.String namespace,
java.lang.String name)
Return the value of the custom property with the given namespace and name
|
java.util.List<Attribute> |
getDependencyAttributes()
Returns list of dependency attributes for this attribute, whose data
changes will cause this attribute's constraint expression to be
reevaluated.
|
java.util.List<java.lang.String> |
getDependencyAttrs()
Returns list of dependency attributes for this attribute, whose data
changes will cause this attribute's constraint expression to be
reevaluated.
|
java.lang.String |
getDescription() |
java.lang.String |
getDisplayLabel()
Returns the display label of this attribute.
|
protected java.lang.String |
getFinderKey(java.lang.String accessorName)
Get the key whose value defines the resource name for this object in URL path
|
java.lang.String |
getFixedChoiceListLookupType()
Returns the fixed choice lookup type if the attribute is defined as
a fixed choice list
|
java.util.Map<java.lang.String,java.util.List> |
getFixedChoiceListValueMap()
Gets the value map if this attribute is a cascading picklist.
|
FormulaType |
getFormulaType()
Returns the type of data the expression will be setting as this attribute
value.
|
java.lang.String |
getHelpText()
Returns a description in terms an application will understand.
|
protected java.lang.String |
getInternalName()
Name that will represent the resource id for this object.
|
static java.lang.String |
getLocalizedString(java.lang.String key,
java.lang.Object... args) |
protected oracle.adfinternal.model.logging.contextual.logger.functional.FunctionalLogger |
getLogger() |
BaseObject.Matcher |
getMatcher()
Get a Matcher that is used to compare with another object.
|
java.lang.String |
getName() |
java.util.List<Attribute> |
getOtherAttributes(java.lang.String relation) |
java.util.List<java.lang.String> |
getOtherAttrs(java.lang.String relation) |
protected oracle.adfinternal.businesseditor.restapi.BaseObject |
getOwner()
Get the container object that contains this object.
|
Attribute |
getParentChoiceList()
Gets the parent the choice list that constrains the values in this choice list.
|
protected java.lang.String[] |
getQueryKeys(java.lang.String accessorName)
Different types of objects use different names to find a child object.
|
protected BaseObject.STATE |
getState() |
java.util.Collection<AttributeTrigger> |
getTriggers()
Retrieve all triggers for this attribute.
|
java.lang.String |
getType()
Returns the type of this attribute.
|
java.lang.String |
getUpdateableExpression()
Returns the expression that determine if an attribute is updateable.
|
java.util.Collection<AttributeValidator> |
getValidators()
Retrieves all validators for the attribute.
|
protected <T> T |
initChildObject(java.lang.String accessorName,
org.codehaus.jettison.json.JSONObject child,
java.lang.Class<T> type)
Various methods that return child object needs to create the child object.
|
boolean |
isNew() |
boolean |
isRemovable()
Returns if this attribute is removable.
|
boolean |
isRequired()
Returns if value is required for this attribute.
|
boolean |
isSearchable()
Returns if this attribute is searchable.
|
boolean |
isUpdateable()
Returns if this attribute is updateable
|
void |
removeDependencyAttr(Attribute attr)
Removes an attribute as dependency attribute, whose data changes will
cause this attribute's constraint expression to be reevaluated
|
void |
removeOtherAttr(Attribute attr,
java.lang.String relation) |
protected void |
setAttribute(java.lang.String attrName,
java.lang.Object value) |
void |
setCustomProperty(java.lang.String namespace,
java.lang.String name,
java.lang.String value)
Create or update a custom property of the given namespace and name with
the value
|
void |
setDescription(java.lang.String text) |
void |
setDisplayLabel(java.lang.String displayLabel)
Sets the display label of this attribute.
|
void |
setHelpText(java.lang.String helpText)
Sets a description in terms an application will understand.
|
protected void |
setLogger(oracle.adfinternal.model.logging.contextual.logger.functional.FunctionalLogger logger) |
void |
setName(java.lang.String name)
Renames this object.
|
void |
setParentChoiceList(Attribute parent,
java.util.Map<java.lang.String,java.util.List> valueMap)
Sets the parent choice list that constrains the values in this choice list.
|
void |
setRequired(boolean required)
Sets if value is required for this attribute.
|
void |
setSearchable(boolean searchable)
Sets if this attribute is searchable.
|
void |
setUpdateableExpression(java.lang.String expression)
Registers the expression that control if this attribute is updateable.
|
protected java.lang.String |
toApiName(java.lang.String name) |
void |
undoChanges() |
protected void |
verifyObjectIsValid()
Verifies if object is valid.
|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, setDescription
public AttributeImpl(BusinessObjectImpl owner, org.codehaus.jettison.json.JSONObject attr) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getAccessorNameFromOwner()
protected <T> T initChildObject(java.lang.String accessorName, org.codehaus.jettison.json.JSONObject child, java.lang.Class<T> type)
T
- Class that is expected type of the returned child object.accessorName
- resource name used to access the childchild
- JSON structure of the child objecttype
- Class instance of the expected type of child objectpublic java.lang.String getType()
Attribute
protected java.lang.String toApiName(java.lang.String name)
public java.util.Collection<AttributeValidator> getValidators()
Attribute
getValidators
in interface Attribute
public AttributeValidator findValidator(java.lang.String name)
Attribute
findValidator
in interface Attribute
name
- name of the validator.public AttributeValidator createValidator(java.lang.String name, java.lang.String ruleDefinition, java.lang.String errorMessage)
Attribute
createValidator
in interface Attribute
name
- name of the validator.ruleDefinition
- validator definitionerrorMessage
- error message for validatorpublic void deleteValidator(AttributeValidator validator)
Attribute
deleteValidator
in interface Attribute
validator
- the validator to be deletedpublic java.util.Collection<AttributeTrigger> getTriggers()
Attribute
getTriggers
in interface Attribute
public AttributeTrigger findTrigger(java.lang.String name)
Attribute
findTrigger
in interface Attribute
name
- name of the trigger.public AttributeTrigger createTrigger(java.lang.String name, java.lang.String triggerDefinition)
Attribute
createTrigger
in interface Attribute
name
- name of the trigger.triggerDefinition
- trigger definition of the triggerpublic AttributeTrigger createTrigger(java.lang.String name, java.lang.String triggerDefinition, java.lang.String errorMessage)
Attribute
createTrigger
in interface Attribute
name
- name of the trigger.triggerDefinition
- trigger definition of the triggererrorMessage
- error message of the triggerpublic void deleteTrigger(AttributeTrigger trigger)
Attribute
deleteTrigger
in interface Attribute
trigger
- the trigger to be deletedpublic void setUpdateableExpression(java.lang.String expression)
Attribute
setUpdateableExpression
in interface Attribute
expression
- the expression to control if this attribute is updateable.public java.lang.String getUpdateableExpression()
Attribute
getUpdateableExpression
in interface Attribute
public void addDependencyAttr(Attribute attr)
Attribute
addDependencyAttr
in interface Attribute
attr
- the new dependent attributepublic void addOtherAttr(Attribute attr, java.lang.String relation)
public void removeDependencyAttr(Attribute attr)
Attribute
removeDependencyAttr
in interface Attribute
attr
- the dependent attribute to be removedpublic void removeOtherAttr(Attribute attr, java.lang.String relation)
public java.util.List<java.lang.String> getDependencyAttrs()
Attribute
getDependencyAttrs
in interface Attribute
public java.util.List<java.lang.String> getOtherAttrs(java.lang.String relation)
public java.util.List<Attribute> getDependencyAttributes()
Attribute
getDependencyAttributes
in interface Attribute
public java.util.List<Attribute> getOtherAttributes(java.lang.String relation)
public void setDisplayLabel(java.lang.String displayLabel)
Attribute
setDisplayLabel
in interface Attribute
displayLabel
- display label of this attributepublic java.lang.String getDisplayLabel()
Attribute
getDisplayLabel
in interface Attribute
public void setHelpText(java.lang.String helpText)
Attribute
setHelpText
in interface Attribute
helpText
- a descriptionpublic java.lang.String getHelpText()
Attribute
getHelpText
in interface Attribute
public void setRequired(boolean required)
Attribute
setRequired
in interface Attribute
required
- if valud is required for this attributepublic boolean isRequired()
Attribute
isRequired
in interface Attribute
public boolean isRemovable()
Attribute
isRemovable
in interface Attribute
public boolean isSearchable()
Attribute
isSearchable
in interface Attribute
public void setSearchable(boolean searchable)
Attribute
setSearchable
in interface Attribute
searchable
- if this attribute is searchable.public FormulaType getFormulaType()
Attribute
getFormulaType
in interface Attribute
public java.lang.String getFixedChoiceListLookupType()
Attribute
getFixedChoiceListLookupType
in interface Attribute
public void setParentChoiceList(Attribute parent, java.util.Map<java.lang.String,java.util.List> valueMap)
Attribute
setParentChoiceList
in interface Attribute
parent
- the attribute of the parent choice listvalueMap
- the value mapping between the parent choice list and this attributepublic Attribute getParentChoiceList()
Attribute
getParentChoiceList
in interface Attribute
public java.util.Map<java.lang.String,java.util.List> getFixedChoiceListValueMap()
Attribute
getFixedChoiceListValueMap
in interface Attribute
public BusinessObject getBusinessObject()
Attribute
getBusinessObject
in interface Attribute
public boolean isUpdateable()
Attribute
isUpdateable
in interface Attribute
public java.util.Map<java.lang.String,java.lang.String> getCustomProperties(java.lang.String namespace)
Attribute
getCustomProperties
in interface Attribute
namespace
- namespace for propertiespublic java.lang.String getCustomProperty(java.lang.String namespace, java.lang.String name)
Attribute
getCustomProperty
in interface Attribute
namespace
- namespace for propertyname
- name to search forpublic void setCustomProperty(java.lang.String namespace, java.lang.String name, java.lang.String value)
Attribute
setCustomProperty
in interface Attribute
namespace
- namespace for propertyname
- name to use for new propertyvalue
- new value for propertyprotected oracle.adfinternal.businesseditor.restapi.BaseObject getOwner()
protected java.lang.String[] getQueryKeys(java.lang.String accessorName)
accessorName
- the resource name to reach a particular type of child objectprotected java.lang.String getFinderKey(java.lang.String accessorName)
accessorName
- the resource name to reach a particular type of child objectprotected final java.lang.String getInternalName()
public java.lang.String getName()
public void setName(java.lang.String name)
BaseObject.ChildAlreadyExists
if there
is a name clash. Whether the name can be overloaded or not is left
to the findChild(Class, Matcher)
name
- new namepublic void setDescription(java.lang.String text)
public java.lang.String getDescription()
protected java.lang.Object getAttribute(java.lang.String attrName)
protected void verifyObjectIsValid()
oracle.jbo.JboException
- if object is invalidprotected java.lang.Object getAttribute(java.lang.String attrName, java.lang.Object defaultValue)
attrName
- name of attributedefaultValue
- default valueprotected oracle.adfinternal.model.logging.contextual.logger.functional.FunctionalLogger getLogger()
protected void setLogger(oracle.adfinternal.model.logging.contextual.logger.functional.FunctionalLogger logger)
protected BaseObject.STATE getState()
public boolean isNew()
protected void setAttribute(java.lang.String attrName, java.lang.Object value)
public BaseObject.Matcher getMatcher()
equals(Object)
which does a finer comparision of the whole URL path. For example,
functions from global functions or different business objects might match in signature
but not equal as their URL path will be different.protected java.util.List<oracle.adfinternal.businesseditor.restapi.BaseObject> getChildrenDeleted(BaseObject.Matcher childMatcher)
protected java.util.List<oracle.adfinternal.businesseditor.restapi.BaseObject> getChildrenNew(BaseObject.Matcher childMatcher)
protected <T> T findChild(java.lang.String accessorName, java.lang.String childName, java.lang.Class<T> type)
protected <T> T findChild(java.lang.Class<T> type, BaseObject.Matcher matcher)
protected <T> java.util.List<T> findChildren(java.lang.Class<T> type, BaseObject.Matcher matcher)
T
- Class that is expected type of the returned children objects.type
- Class instance of type Tmatcher
- Matcher that is used to find the correct childrenprotected org.codehaus.jettison.json.JSONArray getChildrenJSON(java.lang.String accessorName) throws java.lang.Exception
accessorName
- resource name or type of the children objectsjava.lang.Exception
- if any thrown by the GET requestprotected <T> java.util.Collection<T> getChildren(java.lang.String accessorName, java.lang.Class<T> type)
protected <T> T createChild(java.lang.String accessorName, java.lang.Class<T> type, org.codehaus.jettison.json.JSONObject obj)
protected void deleteChild(java.lang.String accessorName, java.lang.String childName)
protected void deleteChild(BaseObject.Matcher matcher)
protected org.codehaus.jettison.json.JSONObject convertToJSON(java.lang.Object... attrNameAndValues)
public void doDeleteChildren()
public void doCreateNewChildren()
public void doSetAttributes()
public void undoChanges()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static java.lang.String getLocalizedString(java.lang.String key, java.lang.Object... args)