public class DefaultFurnitureCatalog extends FurnitureCatalog
.properties
files.Modifier and Type | Class and Description |
---|---|
static class |
DefaultFurnitureCatalog.PropertyKey
The keys of the properties values read in
.properties files. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PLUGIN_FURNITURE_CATALOG_FAMILY
The name of
.properties family files in plugin furniture catalog files. |
Constructor and Description |
---|
DefaultFurnitureCatalog()
Creates a default furniture catalog read from resources in the package of this class.
|
DefaultFurnitureCatalog(java.io.File furniturePluginFolder)
Creates a default furniture catalog read from resources and
furniture plugin folder if
furniturePluginFolder isn't null . |
DefaultFurnitureCatalog(java.net.URL[] pluginFurnitureCatalogUrls)
Creates a default furniture catalog read only from resources in the given URLs.
|
DefaultFurnitureCatalog(java.net.URL[] pluginFurnitureCatalogUrls,
java.net.URL furnitureResourcesUrlBase)
Creates a default furniture catalog read only from resources in the given URLs
or in the classpath if the security manager doesn't allow to create class loaders.
|
DefaultFurnitureCatalog(UserPreferences preferences,
java.io.File furniturePluginFolder)
Creates a default furniture catalog read from resources and
furniture plugin folder if
furniturePluginFolder isn't null . |
DefaultFurnitureCatalog(UserPreferences preferences,
java.io.File[] furniturePluginFolders)
Creates a default furniture catalog read from resources and
furniture plugin folders if
furniturePluginFolders isn't null . |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,Content> |
getAdditionalContents(java.util.ResourceBundle resource,
int index,
java.net.URL furnitureCatalogUrl,
java.net.URL furnitureResourcesUrlBase)
Returns the contents of the piece at the given
index
different from default properties. |
protected java.util.Map<java.lang.String,java.lang.String> |
getAdditionalProperties(java.util.ResourceBundle resource,
int index)
Returns the properties of the piece at the given
index
different from default properties. |
java.util.List<Library> |
getLibraries()
Returns the furniture libraries at initialization.
|
protected boolean |
isDefaultProperty(java.lang.String keyPrefix)
Returns
true if the given parameter is the prefix of a default property
used as an attribute of a piece of furniture. |
protected FurnitureCategory |
readFurnitureCategory(java.util.ResourceBundle resource,
int index)
Returns the furniture category of a piece at the given
index of a
localized resource bundle. |
protected CatalogPieceOfFurniture |
readPieceOfFurniture(java.util.ResourceBundle resource,
int index,
java.net.URL furnitureCatalogUrl,
java.net.URL furnitureResourcesUrlBase)
Returns the piece of furniture at the given
index of a
localized resource bundle. |
add, addFurnitureListener, delete, getCategories, getCategoriesCount, getCategory, getPieceOfFurnitureWithId, removeFurnitureListener
public static final java.lang.String PLUGIN_FURNITURE_CATALOG_FAMILY
.properties
family files in plugin furniture catalog files.public DefaultFurnitureCatalog()
public DefaultFurnitureCatalog(java.io.File furniturePluginFolder)
furniturePluginFolder
isn't null
.public DefaultFurnitureCatalog(UserPreferences preferences, java.io.File furniturePluginFolder)
furniturePluginFolder
isn't null
.public DefaultFurnitureCatalog(UserPreferences preferences, java.io.File[] furniturePluginFolders)
furniturePluginFolders
isn't null
.public DefaultFurnitureCatalog(java.net.URL[] pluginFurnitureCatalogUrls)
public DefaultFurnitureCatalog(java.net.URL[] pluginFurnitureCatalogUrls, java.net.URL furnitureResourcesUrlBase)
furnitureResourcesUrlBase
if it isn't null
.public java.util.List<Library> getLibraries()
protected java.util.Map<java.lang.String,java.lang.String> getAdditionalProperties(java.util.ResourceBundle resource, int index)
index
different from default properties.protected java.util.Map<java.lang.String,Content> getAdditionalContents(java.util.ResourceBundle resource, int index, java.net.URL furnitureCatalogUrl, java.net.URL furnitureResourcesUrlBase)
index
different from default properties.protected boolean isDefaultProperty(java.lang.String keyPrefix)
true
if the given parameter is the prefix of a default property
used as an attribute of a piece of furniture.protected CatalogPieceOfFurniture readPieceOfFurniture(java.util.ResourceBundle resource, int index, java.net.URL furnitureCatalogUrl, java.net.URL furnitureResourcesUrlBase)
index
of a
localized resource
bundle.resource
- a resource bundleindex
- the index of the read piecefurnitureCatalogUrl
- the URL from which piece resources will be loaded
or null
if it's read from current classpath.furnitureResourcesUrlBase
- the URL used as a base to build the URL to piece resources
or null
if it's read from current classpath or furnitureCatalogUrl
null
if the piece at the given index doesn't exist.java.util.MissingResourceException
- if mandatory keys are not defined.protected FurnitureCategory readFurnitureCategory(java.util.ResourceBundle resource, int index)
index
of a
localized resource
bundle.java.util.MissingResourceException
- if mandatory keys are not defined.
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License