|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.gadgets.features.FeatureRegistry
public class FeatureRegistry
Mechanism for loading feature.xml files from a location keyed by a String. That String might be the location of a text file which in turn contains other feature file locations; a directory; or a feature.xml file itself.
| Field Summary | |
|---|---|
static String |
FILE_SCHEME
|
static String |
RESOURCE_SCHEME
|
| Constructor Summary | |
|---|---|
FeatureRegistry(FeatureResourceLoader resourceLoader,
List<String> features)
|
|
| Method Summary | |
|---|---|
Set<String> |
getAllFeatureNames()
Helper method, returns all known feature names. |
List<FeatureResource> |
getAllFeatures()
Returns all known FeatureResources in dependency order, as described in getFeatureResources. |
List<FeatureResource> |
getFeatureResources(GadgetContext ctx,
Collection<String> needed,
List<String> unsupported)
Helper method retrieving feature resources, including transitive dependencies. |
List<FeatureResource> |
getFeatureResources(GadgetContext ctx,
Collection<String> needed,
List<String> unsupported,
boolean transitive)
For the given list of needed features, retrieves all the FeatureResource objects that contain their content and, if requested, that of their transitive dependencies. |
List<String> |
getFeatures(Collection<String> needed)
Calculates and returns a dependency-ordered (as in getFeatureResources) list of features included directly or transitively from the specified list of needed features. |
protected void |
loadFeature(Uri parent,
String xml,
Map<String,org.apache.shindig.gadgets.features.FeatureRegistry.FeatureNode> featureMapBuilder)
Method that loads gadget features. |
protected com.google.common.collect.ImmutableMap<String,org.apache.shindig.gadgets.features.FeatureRegistry.FeatureNode> |
register(List<String> resourceList)
Reads and registers all of the features in the directory, or the file, specified by the given resourceKey. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String RESOURCE_SCHEME
public static final String FILE_SCHEME
| Constructor Detail |
|---|
@Inject
public FeatureRegistry(FeatureResourceLoader resourceLoader,
List<String> features)
throws GadgetException
resourceLoader - featuresoo -
GadgetException| Method Detail |
|---|
protected com.google.common.collect.ImmutableMap<String,org.apache.shindig.gadgets.features.FeatureRegistry.FeatureNode> register(List<String> resourceList)
throws GadgetException
resourceList - The files or directories to load the feature from. If feature.xml
is passed in directly, it will be loaded as a single feature. If a
directory is passed, any features in that directory (recursively) will
be loaded. If res://*.txt or res:*.txt is passed, we will look for named resources
in the text file. If path is prefixed with res:// or res:, the file
is treated as a resource, and all references are assumed to be
resources as well. Multiple locations may be specified by separating
them with a comma.
GadgetException - If any of the files can't be read, are malformed, or invalid.
public List<FeatureResource> getFeatureResources(GadgetContext ctx,
Collection<String> needed,
List<String> unsupported,
boolean transitive)
ctx - Context for the request.needed - List of all needed features.unsupported - If non-null, a List populated with unknown features from the needed list.
GadgetException
public List<FeatureResource> getFeatureResources(GadgetContext ctx,
Collection<String> needed,
List<String> unsupported)
ctx - Context for the request.needed - List of all needed features.unsupported - If non-null, a List populated with unknown features from the needed list.
public List<FeatureResource> getAllFeatures()
public List<String> getFeatures(Collection<String> needed)
needed - List of features for which to obtain an ordered dep list.
public Set<String> getAllFeatureNames()
protected void loadFeature(Uri parent,
String xml,
Map<String,org.apache.shindig.gadgets.features.FeatureRegistry.FeatureNode> featureMapBuilder)
throws GadgetException
parent - uri of parentxml - xml to parse
GadgetException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||