public class ForwardingLibraryImplementation extends Object implements LibraryImplementation, NamedLibraryImplementation, LibraryImplementation2, LibraryImplementation3
LibraryImplementation
.
When possible the implementation delegates to given LibraryImplementation
,
in case that the delegate does not support required contract it throws an UnsupportedOperationException
.PROP_PROPERTIES
PROP_DISPLAY_NAME
PROP_CONTENT, PROP_DESCRIPTION, PROP_NAME
Constructor and Description |
---|
ForwardingLibraryImplementation(LibraryImplementation delegate)
Creates a new
ForwardingLibraryImplementation . |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Adds PropertyChangeListener
|
protected void |
firePropertyChange(String propName,
Object oldValue,
Object newValue) |
List<URL> |
getContent(String volumeType)
Returns List of resources contained in the given volume.
|
LibraryImplementation |
getDelegate()
Returns the delegate.
|
String |
getDescription()
Get a description of the library.
|
String |
getDisplayName()
Returns the display name if available or null.
|
String |
getLocalizingBundle()
Returns the resource name of the bundle which is used for localizing
the name and description.
|
String |
getName()
Returns name of the library
|
Map<String,String> |
getProperties()
Returns library properties
|
String |
getType()
Returns type of library, the LibraryTypeProvider creates libraries
of given unique type.
|
List<URI> |
getURIContent(String volumeType)
Returns List of resources contained in the given volume.
|
void |
removePropertyChangeListener(PropertyChangeListener l)
Removes PropertyChangeListener
|
void |
setContent(String volumeType,
List<URL> path)
Sets content of given volume
|
void |
setDescription(String text)
Sets the description of the library, called by LibrariesStorage while reading the library
The description is more detailed information about the library.
|
void |
setDisplayName(String displayName)
Sets the display name.
|
void |
setLocalizingBundle(String resourceName)
Sets the localizing bundle.
|
void |
setName(String name)
Sets the name of the library, called by LibrariesStorage while reading the library
|
void |
setProperties(Map<String,String> properties)
Sets the library properties
|
void |
setURIContent(String volumeType,
List<URI> path)
Sets content of given volume
|
public ForwardingLibraryImplementation(@NonNull LibraryImplementation delegate)
ForwardingLibraryImplementation
.delegate
- the delegate@NonNull public final LibraryImplementation getDelegate()
protected final void firePropertyChange(@NonNull String propName, @NullAllowed Object oldValue, @NullAllowed Object newValue)
public String getType()
LibraryImplementation
getType
in interface LibraryImplementation
public String getName()
LibraryImplementation
getName
in interface LibraryImplementation
public String getDescription()
LibraryImplementation
getDescription
in interface LibraryImplementation
public String getLocalizingBundle()
LibraryImplementation
getLocalizingBundle
in interface LibraryImplementation
public List<URL> getContent(String volumeType) throws IllegalArgumentException
LibraryImplementation
getContent
in interface LibraryImplementation
volumeType
- the type of volume for which the content should be returned.IllegalArgumentException
- if the library does not support given type of volumepublic void setName(String name)
LibraryImplementation
setName
in interface LibraryImplementation
name
- - the unique name of the library, can't be null.public void setDescription(String text)
LibraryImplementation
setDescription
in interface LibraryImplementation
text
- - the description of the library, may be null.public void setLocalizingBundle(String resourceName)
LibraryImplementation
setLocalizingBundle
in interface LibraryImplementation
resourceName
- of the bundle without extension, may be null.public void addPropertyChangeListener(PropertyChangeListener l)
LibraryImplementation
addPropertyChangeListener
in interface LibraryImplementation
l
- - the PropertyChangeListenerpublic void removePropertyChangeListener(PropertyChangeListener l)
LibraryImplementation
removePropertyChangeListener
in interface LibraryImplementation
l
- - - the PropertyChangeListenerpublic void setContent(String volumeType, List<URL> path) throws IllegalArgumentException
LibraryImplementation
setContent
in interface LibraryImplementation
volumeType
- the type of volume for which the content should be setpath
- the list of resource URLsIllegalArgumentException
- if the library does not support given volumeTypepublic void setDisplayName(String displayName)
NamedLibraryImplementation
setDisplayName
in interface NamedLibraryImplementation
displayName
- the new value of the displayName.
If null resets the display name to the value provided
by the localizing bundle or the identifying name.public String getDisplayName()
NamedLibraryImplementation
getDisplayName
in interface NamedLibraryImplementation
public List<URI> getURIContent(String volumeType) throws IllegalArgumentException
LibraryImplementation2
getURIContent
in interface LibraryImplementation2
volumeType
- the type of volume for which the content should be returned.IllegalArgumentException
- if the library does not support given type of volumepublic void setURIContent(String volumeType, List<URI> path) throws IllegalArgumentException
LibraryImplementation2
setURIContent
in interface LibraryImplementation2
volumeType
- the type of volume for which the content should be setpath
- the list of resource URIsIllegalArgumentException
- if the library does not support given volumeTypepublic Map<String,String> getProperties()
LibraryImplementation3
getProperties
in interface LibraryImplementation3
Map
containing the propertiespublic void setProperties(Map<String,String> properties)
LibraryImplementation3
setProperties
in interface LibraryImplementation3
properties
- the properties to be set