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_PROPERTIESPROP_DISPLAY_NAMEPROP_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()
LibraryImplementationgetType in interface LibraryImplementationpublic String getName()
LibraryImplementationgetName in interface LibraryImplementationpublic String getDescription()
LibraryImplementationgetDescription in interface LibraryImplementationpublic String getLocalizingBundle()
LibraryImplementationgetLocalizingBundle in interface LibraryImplementationpublic List<URL> getContent(String volumeType) throws IllegalArgumentException
LibraryImplementationgetContent in interface LibraryImplementationvolumeType - 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)
LibraryImplementationsetName in interface LibraryImplementationname - - the unique name of the library, can't be null.public void setDescription(String text)
LibraryImplementationsetDescription in interface LibraryImplementationtext - - the description of the library, may be null.public void setLocalizingBundle(String resourceName)
LibraryImplementationsetLocalizingBundle in interface LibraryImplementationresourceName - of the bundle without extension, may be null.public void addPropertyChangeListener(PropertyChangeListener l)
LibraryImplementationaddPropertyChangeListener in interface LibraryImplementationl - - the PropertyChangeListenerpublic void removePropertyChangeListener(PropertyChangeListener l)
LibraryImplementationremovePropertyChangeListener in interface LibraryImplementationl - - - the PropertyChangeListenerpublic void setContent(String volumeType, List<URL> path) throws IllegalArgumentException
LibraryImplementationsetContent in interface LibraryImplementationvolumeType - 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)
NamedLibraryImplementationsetDisplayName in interface NamedLibraryImplementationdisplayName - 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()
NamedLibraryImplementationgetDisplayName in interface NamedLibraryImplementationpublic List<URI> getURIContent(String volumeType) throws IllegalArgumentException
LibraryImplementation2getURIContent in interface LibraryImplementation2volumeType - 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
LibraryImplementation2setURIContent in interface LibraryImplementation2volumeType - 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()
LibraryImplementation3getProperties in interface LibraryImplementation3Map containing the propertiespublic void setProperties(Map<String,String> properties)
LibraryImplementation3setProperties in interface LibraryImplementation3properties - the properties to be set