org.glassfish.jersey.model.internal
Class FeatureBag

java.lang.Object
  extended by org.glassfish.jersey.model.internal.FeatureBag

public class FeatureBag
extends Object

A container for features to be enabled used during the server or client initialization.

  • Stores the order in which all registered features should be enabled.
  • Knows about already enabled features.
  • Feature instances added to this bag takes precedence over added feature classes.
  • Note: Features are configured immediately before binding time of all providers and resources (on server).

    Author:
    Michal Gajdos (michal.gajdos at oracle.com)

    Nested Class Summary
    static class FeatureBag.Builder
              Feature bag builder.
    static class FeatureBag.RegisteredFeature
               
     
    Method Summary
     boolean equals(Object obj)
               
     Set<Feature> getEnabledFeatures()
              Returns a set of already enabled features.
     List<FeatureBag.RegisteredFeature> getUnconfiguredFeatures()
              Returns an unmodifiable list of un-configured features in order they were added.
     int hashCode()
               
     boolean isEnabled(Class<? extends Feature> featureClass)
              Indicates whether any feature of given featureClass is already enabled or not.
     boolean isEnabled(Feature feature)
              Indicates whether the given feature is already enabled or not.
     boolean isRegistered(FeatureBag.RegisteredFeature registeredFeature)
               
     void setEnabled(Feature feature)
               
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
     

    Method Detail

    getUnconfiguredFeatures

    public List<FeatureBag.RegisteredFeature> getUnconfiguredFeatures()
    Returns an unmodifiable list of un-configured features in order they were added.

    Returns:
    a non-null list of features.

    getEnabledFeatures

    public Set<Feature> getEnabledFeatures()
    Returns a set of already enabled features.

    Returns:
    set of already enabled features.

    isEnabled

    public boolean isEnabled(Class<? extends Feature> featureClass)
    Indicates whether any feature of given featureClass is already enabled or not.

    Parameters:
    featureClass - feature class to check.
    Returns:
    true if a feature of given class has been already enabled, false otherwise.

    isEnabled

    public boolean isEnabled(Feature feature)
    Indicates whether the given feature is already enabled or not.

    Parameters:
    feature - feature to check.
    Returns:
    true if the feature has been already enabled, false otherwise.

    setEnabled

    public void setEnabled(Feature feature)

    isRegistered

    public boolean isRegistered(FeatureBag.RegisteredFeature registeredFeature)

    equals

    public boolean equals(Object obj)
    Overrides:
    equals in class Object

    hashCode

    public int hashCode()
    Overrides:
    hashCode in class Object


    Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.