Class ResourceImpl
- java.lang.Object
-
- org.apache.felix.bundlerepository.impl.ResourceImpl
-
- All Implemented Interfaces:
Resource
- Direct Known Subclasses:
LocalResourceImpl
public class ResourceImpl extends java.lang.Object implements Resource
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List
m_capList
private int
m_hash
private java.util.Map
m_map
private Repository
m_repo
private java.util.List
m_reqList
private java.util.Map
m_uris
-
Fields inherited from interface org.apache.felix.bundlerepository.Resource
CATEGORY, COPYRIGHT, DESCRIPTION, DOCUMENTATION_URI, ID, JAVADOC_URI, LICENSE_URI, MANIFEST_VERSION, PRESENTATION_NAME, SIZE, SOURCE_URI, SYMBOLIC_NAME, URI, VERSION
-
-
Constructor Summary
Constructors Constructor Description ResourceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCapability(Capability cap)
void
addCategory(java.lang.String category)
void
addRequire(Requirement req)
private void
convertURIs()
boolean
equals(java.lang.Object o)
private long
findResourceSize()
private long
findResourceSize(java.net.URL url)
Capability[]
getCapabilities()
Retrieve the capabilitiesjava.lang.String[]
getCategories()
Retrieve this resource categoriesjava.lang.String
getId()
Shortcut for {{getProperties().get(ID)}}java.lang.String
getPresentationName()
Shortcut for {{getProperties().get(PRESENTATION_NAME)}}java.util.Map
getProperties()
Get all resource propertiesRepository
getRepository()
Requirement[]
getRequirements()
Retrieve the requirementsjava.lang.Long
getSize()
Shortcut for {{getProperties().get(SIZE)}}java.lang.String
getSymbolicName()
Shortcut for {{getProperties().get(SYMBOLIC_NAME)}}java.lang.String
getURI()
Shortcut for {{getProperties().get(URI)}}org.osgi.framework.Version
getVersion()
Shortcut for {{getProperties().get(VERSION)}}int
hashCode()
boolean
isLocal()
Returns whether this resource is a local one or not.java.lang.Object
put(java.lang.Object key, java.lang.Object value)
Default setter method when setting parsed data from the XML file.void
put(java.lang.String key, java.lang.String value, java.lang.String type)
private java.lang.String
resolveUri(java.lang.String uri)
void
setRepository(Repository repository)
java.lang.String
toString()
-
-
-
Field Detail
-
m_map
private final java.util.Map m_map
-
m_capList
private final java.util.List m_capList
-
m_reqList
private final java.util.List m_reqList
-
m_repo
private Repository m_repo
-
m_uris
private java.util.Map m_uris
-
m_hash
private transient int m_hash
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getRepository
public Repository getRepository()
-
setRepository
public void setRepository(Repository repository)
-
getProperties
public java.util.Map getProperties()
Description copied from interface:Resource
Get all resource properties- Specified by:
getProperties
in interfaceResource
- Returns:
-
getPresentationName
public java.lang.String getPresentationName()
Description copied from interface:Resource
Shortcut for {{getProperties().get(PRESENTATION_NAME)}}- Specified by:
getPresentationName
in interfaceResource
- Returns:
-
getSymbolicName
public java.lang.String getSymbolicName()
Description copied from interface:Resource
Shortcut for {{getProperties().get(SYMBOLIC_NAME)}}- Specified by:
getSymbolicName
in interfaceResource
- Returns:
-
getId
public java.lang.String getId()
Description copied from interface:Resource
Shortcut for {{getProperties().get(ID)}}
-
getVersion
public org.osgi.framework.Version getVersion()
Description copied from interface:Resource
Shortcut for {{getProperties().get(VERSION)}}- Specified by:
getVersion
in interfaceResource
- Returns:
-
getURI
public java.lang.String getURI()
Description copied from interface:Resource
Shortcut for {{getProperties().get(URI)}}
-
getSize
public java.lang.Long getSize()
Description copied from interface:Resource
Shortcut for {{getProperties().get(SIZE)}}
-
findResourceSize
private long findResourceSize()
-
findResourceSize
private long findResourceSize(java.net.URL url) throws java.io.IOException
- Throws:
java.io.IOException
-
getRequirements
public Requirement[] getRequirements()
Description copied from interface:Resource
Retrieve the requirements- Specified by:
getRequirements
in interfaceResource
- Returns:
-
addRequire
public void addRequire(Requirement req)
-
getCapabilities
public Capability[] getCapabilities()
Description copied from interface:Resource
Retrieve the capabilities- Specified by:
getCapabilities
in interfaceResource
- Returns:
-
addCapability
public void addCapability(Capability cap)
-
getCategories
public java.lang.String[] getCategories()
Description copied from interface:Resource
Retrieve this resource categories- Specified by:
getCategories
in interfaceResource
- Returns:
-
addCategory
public void addCategory(java.lang.String category)
-
isLocal
public boolean isLocal()
Description copied from interface:Resource
Returns whether this resource is a local one or not. Local resources are already available in the OSGi framework and thus will be preferred over other resources.
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
Default setter method when setting parsed data from the XML file.
-
put
public void put(java.lang.String key, java.lang.String value, java.lang.String type)
-
convertURIs
private void convertURIs()
-
resolveUri
private java.lang.String resolveUri(java.lang.String uri)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-