net.dpml.library.info
Class FeatureFilterDirective

java.lang.Object
  extended by net.dpml.lang.AbstractDirective
      extended by net.dpml.library.info.FilterDirective
          extended by net.dpml.library.info.FeatureFilterDirective
All Implemented Interfaces:
Serializable, Filter

public class FeatureFilterDirective
extends FilterDirective

Simple value filter.

Version:
1.2.0
Author:
Digital Product Meta Library
See Also:
Serialized Form

Constructor Summary
FeatureFilterDirective(String token, String ref, Feature feature, String type, boolean alias)
          Creation of a new anonymous resource directive.
 
Method Summary
 boolean equals(Object other)
          Compare this object with another for equality.
 String getResourceReference()
          Get the resource ref value.
 String getValue(Resource resource)
          Return the filter value.
 int hashCode()
          Compute the hash value.
 
Methods inherited from class net.dpml.library.info.FilterDirective
getToken
 
Methods inherited from class net.dpml.lang.AbstractDirective
equals, hashArray, hashValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureFilterDirective

public FeatureFilterDirective(String token,
                              String ref,
                              Feature feature,
                              String type,
                              boolean alias)
Creation of a new anonymous resource directive.

Parameters:
token - the filter token
ref - an external resource refernce (possibly null)
feature - the resource feature
type - the resource type
alias - if the alias flag
Method Detail

getResourceReference

public String getResourceReference()
Get the resource ref value. If null the ref shall be interprited as the enclosing project.

Returns:
the ref value

getValue

public String getValue(Resource resource)
                throws ResourceNotFoundException
Return the filter value.

Specified by:
getValue in interface Filter
Specified by:
getValue in class FilterDirective
Parameters:
resource - the enclosing resource
Returns:
the resolved value
Throws:
ResourceNotFoundException - if the feature references a resource that is unknown

equals

public boolean equals(Object other)
Compare this object with another for equality.

Overrides:
equals in class FilterDirective
Parameters:
other - the other object
Returns:
true if equal

hashCode

public int hashCode()
Compute the hash value.

Overrides:
hashCode in class FilterDirective
Returns:
the hashcode value