public final class CSAttribute extends CSItem
The CSAttribute
class includes methods for the retrieval of a particular attribute's details.
All such methods require that certain database and key information (attribute ID, for example) be specified via the
set
methods provided, prior to their invocation.
All database access/connectivity is handled internally by the CSAttribute
class.
CSAttributeContent
,
CSAttributeMultiple
,
CSState
,
Serialized FormACCESS_GRANTED, DOES_NOT_EXIST, EMPTY, EXISTS, SECURE_ACCESS_DENIED, SECURE_ACCESS_GRANTED, UPDATE_ACTION_INSERTED, UPDATE_ACTION_UPDATED
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSAttribute()
Creates an empty
CSAttribute object. |
CSAttribute(CSAttribute objItem)
Creates an empty
CSAttribute object, and initialises it from the contents of the supplied CSItem
object. |
CSAttribute(java.lang.String strPropertyFile)
Creates a new
CSAttribute , specifying a property file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSAttribute . |
boolean |
exist()
Determines whether an attribute exists on the database.
|
void |
get()
Retrieves the details of an attribute from the database.
|
int |
getAttributeID()
Gets the ID of the attribute to be used as key information.
|
CSAttributeType |
getAttributeType()
Gets the parent
CSAttributeType of the attribute. |
int |
getDisplayOrder()
Gets the display order of the attribute.
|
java.lang.String |
getName()
Gets the name of the attribute to be used as key information.
|
java.lang.String |
getTypeName()
Gets the name of the attribute type to be used as key information.
|
void |
setAttributeID(int nAttributeID)
Sets the attribute ID to be used as key information.
|
void |
setAttributeType(CSAttributeType objAttributeType)
Sets the parent
CSAttributeType of the attribute. |
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setDisplayOrder(int nDisplayOrder)
Sets the display order of the attribute.
|
void |
setName(java.lang.String strName)
Sets the name of the attribute to be used as key information.
|
void |
setTypeName(java.lang.String strAttributeTypeName)
Sets the name of the attribute type to be used as key information.
|
void |
update()
Not currently implemented for
CSAttribute . |
equals, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, toString, unset
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSAttribute()
CSAttribute
object.
Use the various set methods provided to initialise the CSAttribute
object prior to invoking any of
its query methods.
public CSAttribute(CSAttribute objItem)
CSAttribute
object, and initialises it from the contents of the supplied CSItem
object.
objItem
- the CSAttribute
object to be used to initialise the new onepublic CSAttribute(java.lang.String strPropertyFile)
CSAttribute
, specifying a property file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSAttribute
object prior to invoking any of
its query methods.
strPropertyFile
- the property file that contains the connection details.public CSAttributeType getAttributeType()
CSAttributeType
of the attribute.
public void setAttributeType(CSAttributeType objAttributeType)
CSAttributeType
of the attribute.
objAttributeType
- the attribute's parent attribute type.public int getAttributeID()
public void setAttributeID(int nAttributeID)
setAttributeID
followed by a call to get
will return details of the attribute with
the specified attribute ID.
nAttributeID
- the attribute's ID to be used as key information.public java.lang.String getName()
public void setName(java.lang.String strName)
setName
followed by a call to get
will return details of the attribute with the
specified name.
strName
- the attribute's name to be used as key information.public int getDisplayOrder()
public void setDisplayOrder(int nDisplayOrder)
nDisplayOrder
- the attribute's display order.public java.lang.String getTypeName()
public void setTypeName(java.lang.String strAttributeTypeName)
setTypeName
in conjunction with either setAttributeID
or
setName
followed by a call to get
will return details of the attribute
with the specified name and is a child of the specified attribute type.
strAttributeTypeName
- the attribute type's name to be used as key information.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for an attribute are :
LEVEL_ID
Retrieves AttributeID only.LEVEL_SUMMARY
Retrieves AttributeName and CSAttributeType
details for this detail
level.LEVEL_ALL
Retrieves all attribute data and CSAttributeType
details for this
detail level.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public boolean exist() throws CSException
Use setAttributeID
followed by exist
to ascertain if there is an
attribute with the specified ID on the database.
Use setName
followed by exist
to ascertain if there is an attribute with
the specified name on the database.
Use either setAttributeID
or setName
in conjunction with
setTypeName
followed by exist
to ascertain if there is an attribute
with the specified ID, name and has the specified parent attribute type on the database.
exist
in class CSItem
true
if this attribute exists on the database.CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void get() throws CSException
If it is not necessary to retrieve all the details of the attribute then specify the amount of detail required
using the setDetailLevel
method before calling this method.
Use setAttributeID
followed by get
to populate this
CSAttribute
object with the details of the attribute identified by the specified ID.
Use setName
followed by get
to populate this CSAttribute
object with the details of the attribute identified by the specified name.
Use either setAttributeID
or setName
in conjunction with
setTypeName
followed by get
to populate this CSAttribute
object with the details of the attribute identified by the specified ID, name and has the specified parent
attribute type.
get
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified attribute cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void update() throws CSException
CSAttribute
.
update
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified attributes cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSAttribute
.
delete
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified attributes cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.