Package liquibase
Interface ExtensibleObject
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
AbstractChange
,AbstractExtensibleObject
,AbstractLogger
,AbstractModifyDataChange
,AbstractPathResourceAccessor
,AbstractPlugin
,AbstractResourceAccessor
,AbstractSQLChange
,AbstractTableChange
,AddAutoIncrementChange
,AddColumnChange
,AddDefaultValueChange
,AddForeignKeyConstraintChange
,AddLookupTableChange
,AddNotNullConstraintChange
,AddPrimaryKeyChange
,AddUniqueConstraintChange
,AlterSequenceChange
,AntResourceAccessor
,AntTaskLogger
,BufferedLogger
,ClassLoaderResourceAccessor
,CompositeLogger
,CompositeResourceAccessor
,CompositeUIService
,ConsoleUIService
,CreateIndexChange
,CreateProcedureChange
,CreateSequenceChange
,CreateTableChange
,CreateViewChange
,CustomChangeWrapper
,DeleteDataChange
,DirectoryResourceAccessor
,DropAllForeignKeyConstraintsChange
,DropColumnChange
,DropDefaultValueChange
,DropForeignKeyConstraintChange
,DropIndexChange
,DropNotNullConstraintChange
,DropPrimaryKeyChange
,DropProcedureChange
,DropSequenceChange
,DropTableChange
,DropUniqueConstraintChange
,DropViewChange
,EmptyChange
,ExecuteShellCommandChange
,FileSystemResourceAccessor
,InsertDataChange
,JavaLogger
,LoadDataChange
,LoadUpdateDataChange
,LoggerUIService
,MavenResourceAccessor
,MavenUi
,MergeColumnChange
,MockResourceAccessor
,ModifyDataTypeChange
,NoOpLogger
,OSGiResourceAccessor
,OutputChange
,RawSQLChange
,RenameColumnChange
,RenameSequenceChange
,RenameTableChange
,RenameViewChange
,SearchPathResourceAccessor
,SetColumnRemarksChange
,SetTableRemarksChange
,SpringResourceAccessor
,SQLFileChange
,StopChange
,TagDatabaseChange
,UpdateDataChange
,ZipResourceAccessor
This interface defines how objects can be extended with additional attributes at runtime without subclassing and exposes the ability to query attributes without resorting to reflection.
If creating an ExtensibleObject, it is usually best to extend AbstractExtensibleObject
rather than this interface directly.
You should also create a test that extends from AbstractExtensibleObjectTest.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
ExposeCloneable#clone()
as publicdescribe()
Output a full description of this object.<T> T
Return the current value of the given attribute name, converted to the passed type.<T> T
Works likeget(String, Class)
but if the attribute is null or not defined, returns the passed defaultValue.Return the names of all the set attributes.Returns theObjectMetaData
describing this instance.getValuePath
(String attributePath, Class lastType) Traverses dot-separated attributes in the attributePath and returns a list containing all the intermediate values.boolean
Returns true if the given attribute is set and not null.Sets the value of the given attribute.
-
Method Details
-
getAttributes
Return the names of all the set attributes. If an attribute is null the name should not be returned. Should return both "standard" attributes and any custom attributes that have been set. -
getObjectMetaData
ObjectMetaData getObjectMetaData()Returns theObjectMetaData
describing this instance. -
has
Returns true if the given attribute is set and not null. -
getValuePath
Traverses dot-separated attributes in the attributePath and returns a list containing all the intermediate values.- Parameters:
lastType
- the type to convert the last value in the list to.
-
get
Return the current value of the given attribute name, converted to the passed type. If the passed attribute is null or not defined, returns null. If you do not know the type to convert to, pass Object.class as the type. Conversion is done usingObjectUtil.convert(Object, Class)
. Should traverse dot-separated attributes. -
get
Works likeget(String, Class)
but if the attribute is null or not defined, returns the passed defaultValue. Uses the type of defaultValue to determine the type to convert the current value to.If null is passed to the default value, no conversion of attribute is made if it is set. If traversing a dot-separated attribute path, return the default value if any along the path are null.
-
set
Sets the value of the given attribute. Subclasses can override this method to provide conversion business logic, but must remember that fields can be set directly when no type conversion is needed. -
describe
String describe()Output a full description of this object. Should include all attributes and values. -
clone
Object clone()ExposeCloneable#clone()
as public
-