Class Property<T>
- java.lang.Object
-
- com.tagtraum.beatunes.Property<T>
-
public abstract class Property<T> extends Object
Describes and helps manipulating a property of a given value. As such it is like a more concrete version of a
PropertyDescriptorthat supports undo (seesetUndoable(Object, Object)).E.g. a class has a property called
name. Use this interface to implement a class that callsgetName()to get the value of the property orsetName(String)to set a new value.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProperty.PropertyUndoableEdit<T>SpecialUndoableEditwith modifiableProperty.PropertyUndoableEdit.getPresentationName().
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Property()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Tget(Object o)Returns a property value.StringgetFullyQualifiedName()Returns the fully qualified name, that can be used in HQL queries, which usesongas alias for theSongtable.static <T> Property<T>getInstance(String propertyName)Get property instance based on a name.abstract StringgetLabel()Label to be used as key inBeaTunes.localize(String, Object...).abstract StringgetName()Name of the property.StringgetObjectPath()Object path to this property.StringgetSQLName()SQL name of the property, i.e., the column name.abstract Class<? extends T>getValueClass()Class values are in.abstract voidset(Object o, T value)Sets a property value.Property.PropertyUndoableEdit<T>setUndoable(Object object, T newValue)Sets the value of the property in an undoable way.StringtoString()
-
-
-
Field Detail
-
SPECTRUM_PROPERTY
public static final Property<com.tagtraum.audiokern.timbre.BarkSpectrum> SPECTRUM_PROPERTY
-
TRACK_REPLAY_GAIN_PROPERTY
public static final Property<ReplayGain> TRACK_REPLAY_GAIN_PROPERTY
-
ALBUM_REPLAY_GAIN_PROPERTY
public static final Property<ReplayGain> ALBUM_REPLAY_GAIN_PROPERTY
-
TIME_SIGNATURE_PROPERTY
public static final Property<TimeSignature> TIME_SIGNATURE_PROPERTY
-
TEMPO_PROPERTY
public static final Property<com.tagtraum.audiokern.bpm.Tempo> TEMPO_PROPERTY
-
AUDIO_ARTWORKS_PROPERTY
public static final Property<AudioArtwork[]> AUDIO_ARTWORKS_PROPERTY
-
MEDIA_KIND_PROPERTY
public static final Property<AudioSong.MediaKind> MEDIA_KIND_PROPERTY
-
CLOUD_STATUS_PROPERTY
public static final Property<AudioSong.CloudStatus> CLOUD_STATUS_PROPERTY
-
LIKING_PROPERTY
public static final Property<AudioSong.Liking> LIKING_PROPERTY
-
ALBUM_LIKING_PROPERTY
public static final Property<AudioSong.Liking> ALBUM_LIKING_PROPERTY
-
INSTRUMENTATION_PROPERTY
public static final Property<AudioSong.Instrumentation> INSTRUMENTATION_PROPERTY
-
PROGRESS_PROPERTY
public static final Property<Object> PROGRESS_PROPERTY
DummyPropertyobject used onAnalysisQueueColumnModel. You cannot use this property to actually read or write a value. It's used merely for its name, label and renderer.
-
-
Method Detail
-
get
public abstract T get(Object o)
Returns a property value.- Parameters:
o- object- Returns:
- the value of the property
-
set
public abstract void set(Object o, T value)
Sets a property value.- Parameters:
o- objectvalue- value to set
-
getName
public abstract String getName()
Name of the property.- Returns:
- property name
-
getSQLName
public String getSQLName()
SQL name of the property, i.e., the column name.- Returns:
- column name
-
getObjectPath
public String getObjectPath()
Object path to this property. E.g., if the property belongs directly to aSongobject, it's"song". If it belongs toSongAnnotation, it's"song.songAnnotation"- Returns:
- by default this returns
"song".
-
getFullyQualifiedName
public final String getFullyQualifiedName()
Returns the fully qualified name, that can be used in HQL queries, which use
songas alias for theSongtable. E.g. the fully qualified name for "artist" is "song.artist". Any properties that are persisted inSongAnnotationfollow the pattern "song.songAnnotation.PROPERTY_NAME". E.g. "song.songAnnotation.custom1".The fully qualified name always consists of
.getObjectPath()+ "." +getName()- Returns:
- fully qualified name
-
getLabel
public abstract String getLabel()
Label to be used as key inBeaTunes.localize(String, Object...).- Returns:
- (not localized) label
-
setUndoable
public Property.PropertyUndoableEdit<T> setUndoable(Object object, T newValue)
Sets the value of the property in an undoable way.- Parameters:
object- objectnewValue- value- Returns:
- an
UndoableEditthat allows reversal of this call. Note that the presentation name is not localized and must be adjusted, if it should be used in a localized context.
-
getValueClass
public abstract Class<? extends T> getValueClass()
Class values are in.- Returns:
- class
-
getInstance
public static <T> Property<T> getInstance(String propertyName)
Get property instance based on a name. The name can be either simple ("artist") or fully qualified ("song.songAnnotation.custom1").- Type Parameters:
T- type of the property- Parameters:
propertyName- name- Returns:
- property object or
null, if not found.
-
-