public abstract class SandboxedFeatures
extends java.lang.Object
implements java.lang.Iterable<java.lang.String>
SandboxedFeature
s.Constructor and Description |
---|
SandboxedFeatures() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAdditionalInformation(java.lang.String id)
Returns the additional information of a sandboxed feature supported by
this factory.
|
java.lang.String |
getIcon(java.lang.String id)
Returns the icon of a sandboxed feature supported by this factory.
|
static SandboxedFeatures |
getInstance(java.lang.Class callerClass)
Returns a collection of sandboxed features provided by the system
SandboxSessionSupport or discovered from the current thread's
context class loader or the caller's class loader |
java.lang.String |
getName(java.lang.String id)
Returns the name of a sandboxed feature supported by this factory.
|
java.lang.String |
getPreferredApplication(java.lang.String id)
Returns the URL associated with a sandboxed feature supported by this
factory.
|
java.lang.Object |
getProperty(java.lang.String id,
java.lang.String key)
Returns the value of a property associated with a sandboxed feature.
|
SandboxedFeature |
getSandboxedFeature(java.lang.String id)
Returns a new or cached instance of the specified
SandboxedFeature . |
java.lang.String |
getShortDescription(java.lang.String id)
Returns the short description of a sandboxed feature supported by this
factory.
|
boolean |
isHidden(java.lang.String id)
Returns
true if a sandboxed feature supported by this factory
is hidden from the current context. |
boolean |
isPermitted(java.lang.String id)
Returns
true if a sandboxed feature supported by this factory
is permitted in the current context. |
abstract java.util.Iterator<java.lang.String> |
iterator()
Returns an iterator over the IDs of the
SandboxedFeature s in
this collection. |
SandboxedFeatures |
newPropertyCache()
Returns a new collection that is the same as this collection, but with
properties cached upon the first access.
|
abstract SandboxedFeature |
newSandboxedFeatureInstance(java.lang.String id)
Returns a new instance of the specified
SandboxedFeature . |
public abstract java.util.Iterator<java.lang.String> iterator()
SandboxedFeature
s in
this collection.iterator
in interface java.lang.Iterable<java.lang.String>
SandboxedFeature
s in
the collectionpublic abstract SandboxedFeature newSandboxedFeatureInstance(java.lang.String id)
SandboxedFeature
.id
- the ID of the sandboxed featurejava.lang.IllegalArgumentException
- if the ID is null
or
not in this collectionpublic SandboxedFeature getSandboxedFeature(java.lang.String id)
SandboxedFeature
. By default, an instance that has been
requested at least once is cached in this collection. Subclasses may
override this method to modify the caching mechanism.id
- the ID of the sandboxed featurejava.lang.IllegalArgumentException
- if the ID is null
or
not in this collectionpublic java.lang.String getName(java.lang.String id)
The default implementation gets an instance of the sandboxed feature
by calling getSandboxedFeature
and delegates the call to
the instance. Subclasses may override this method to retrieve this
information from external sources without instantiating the
SandboxedFeature
class. If overridden, the information
returned by this method may or may not be the same as the information
returned by the SandboxedFeature
instance.
id
- the ID of the sandboxed featurejava.lang.IllegalArgumentException
- if the ID is null
or
invalidgetSandboxedFeature(java.lang.String)
public java.lang.String getShortDescription(java.lang.String id)
The default implementation gets an instance of the sandboxed feature
by calling getSandboxedFeature
and delegates the call to
the instance. Subclasses may override this method to retrieve this
information from external sources without instantiating the
SandboxedFeature
class. If overridden, the information
returned by this method may or may not be the same as the information
returned by the SandboxedFeature
instance.
id
- the ID of the sandboxed featurejava.lang.IllegalArgumentException
- if the ID is null
or
invalidgetSandboxedFeature(java.lang.String)
public java.lang.String getAdditionalInformation(java.lang.String id)
The default implementation gets an instance of the sandboxed feature
by calling getSandboxedFeature
and delegates the call to
the instance. Subclasses may override this method to retrieve this
information from external sources without instantiating the
SandboxedFeature
class. If overridden, the information
returned by this method may or may not be the same as the information
returned by the SandboxedFeature
instance.
id
- the ID of the sandboxed featurejava.lang.IllegalArgumentException
- if the ID is null
or
invalidgetSandboxedFeature(java.lang.String)
public java.lang.String getPreferredApplication(java.lang.String id)
The default implementation gets an instance of the sandboxed feature
by calling getSandboxedFeature
and delegates the call to
the instance. Subclasses may override this method to retrieve this
information from external sources without instantiating the
SandboxedFeature
class. If overridden, the information
returned by this method may or may not be the same as the information
returned by the SandboxedFeature
instance.
id
- the ID of the sandboxed featurejava.lang.IllegalArgumentException
- if the ID is null
or
invalidgetSandboxedFeature(java.lang.String)
public java.lang.String getIcon(java.lang.String id)
The default implementation gets an instance of the sandboxed feature
by calling getSandboxedFeature
and delegates the call to
the instance. Subclasses may override this method to retrieve this
information from external sources without instantiating the
SandboxedFeature
class. If overridden, the information
returned by this method may or may not be the same as the information
returned by the SandboxedFeature
instance.
id
- the ID of the sandboxed featurejava.lang.IllegalArgumentException
- if the ID is null
or
invalidgetSandboxedFeature(java.lang.String)
public boolean isHidden(java.lang.String id)
true
if a sandboxed feature supported by this factory
is hidden from the current context.
The default implementation gets an instance of the sandboxed feature
by calling getSandboxedFeature
and delegates the call to
the instance. Subclasses may override this method to retrieve this
information from external sources without instantiating the
SandboxedFeature
class. If overridden, the information
returned by this method may or may not be the same as the information
returned by the SandboxedFeature
instance.
id
- the ID of the sandboxed featuretrue
if the sandboxed feature supported by this
factory is hidden from the current contextjava.lang.IllegalArgumentException
- if the ID is null
or
invalidgetSandboxedFeature(java.lang.String)
public boolean isPermitted(java.lang.String id)
true
if a sandboxed feature supported by this factory
is permitted in the current context.
The default implementation gets an instance of the sandboxed feature
by calling getSandboxedFeature
and delegates the call to
the instance. Subclasses may override this method to retrieve this
information from external sources without instantiating the
SandboxedFeature
class. If overridden, the information
returned by this method may or may not be the same as the information
returned by the SandboxedFeature
instance.
id
- the ID of the sandboxed featuretrue
if the sandboxed feature supported by this
factory is permitted in the current contextjava.lang.IllegalArgumentException
- if the ID is null
or
invalidgetSandboxedFeature(java.lang.String)
public java.lang.Object getProperty(java.lang.String id, java.lang.String key)
id
- the ID of the sandboxed featurekey
- the property keyjava.lang.IllegalArgumentException
- if the ID is null
or
invalidpublic SandboxedFeatures newPropertyCache()
SandboxedFeatures.getName
)
are cached. Once a property value is cached, it is never updated.
The returned collection is not thread-safe.public static SandboxedFeatures getInstance(java.lang.Class callerClass)
SandboxSessionSupport
or discovered from the current thread's
context class loader or the caller's class loadercallerClass
- the class of the caller. The class loader of the class
may be used to discover the sandboxed features when
SandboxSessionSupport
does not provide
a collection and the current thread's context class
loader is not availableSandboxSessionSupport
or discovered from the current
thread's context class loader or the caller's class loader. Note
that as soon as a non-null collection is obtained, this method
returns the collection without considering the next source. There
is no merging of collections from multiple sources.