| 
SunTM's XACML Implementation for JavaTM | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xacml.attr.AttributeSelector
Supports the standard selector functionality in XACML, which uses XPath
 expressions to resolve values from the Request or elsewhere. All selector
 queries are done by AttributeFinderModules so that it's easy
 to plugin different XPath implementations.
| Constructor Summary | |
AttributeSelector(URI type,
                  String contextPath,
                  boolean mustBePresent,
                  String xpathVersion)
Creates a new AttributeSelector with no policy root. | 
|
AttributeSelector(URI type,
                  String contextPath,
                  Node policyRoot,
                  boolean mustBePresent,
                  String xpathVersion)
Creates a new AttributeSelector. | 
|
| Method Summary | |
 void | 
encode(OutputStream output)
Encodes this selector into its XML representation and writes this encoding to the given OutputStream with no
 indentation. | 
 void | 
encode(OutputStream output,
       Indenter indenter)
Encodes this selector into its XML representation and writes this encoding to the given OutputStream with
 indentation. | 
 EvaluationResult | 
evaluate(EvaluationCtx context)
Invokes the AttributeFinder used by the given
 EvaluationCtx to try to resolve an attribute value. | 
 boolean | 
evaluatesToBag()
Always returns true, since a selector always returns a bag of attribute values.  | 
 List | 
getChildren()
Always returns an empty list since selectors never have children.  | 
 String | 
getContextPath()
Returns the XPath query used to resolve attribute values.  | 
static AttributeSelector | 
getInstance(Node root,
            String xpathVersion)
Creates a new AttributeSelector based on the DOM root
 of the XML type. | 
 URI | 
getType()
Returns the data type of the attribute values that this selector will resolve  | 
 String | 
getXPathVersion()
Returns the XPath version this selector is supposed to use.  | 
 boolean | 
mustBePresent()
Returns whether or not a value is required to be resolved by this selector.  | 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public AttributeSelector(URI type,
                         String contextPath,
                         boolean mustBePresent,
                         String xpathVersion)
AttributeSelector with no policy root.
type - the data type of the attribute values this selector
             looks forcontextPath - the XPath to querymustBePresent - must resolution find a matchxpathVersion - the XPath version to use, which must be a valid
                     XPath version string (the identifier for XPath 1.0
                     is provided in AbstractPolicy)
public AttributeSelector(URI type,
                         String contextPath,
                         Node policyRoot,
                         boolean mustBePresent,
                         String xpathVersion)
AttributeSelector.
type - the data type of the attribute values this selector
             looks forcontextPath - the XPath to querypolicyRoot - the root DOM Element for the policy containing this
                   selector, which defines namespace mappingsmustBePresent - must resolution find a matchxpathVersion - the XPath version to use, which must be a valid
                     XPath version string (the identifier for XPath 1.0
                     is provided in AbstractPolicy)| Method Detail | 
public static AttributeSelector getInstance(Node root,
                                            String xpathVersion)
                                     throws ParsingException
AttributeSelector based on the DOM root
 of the XML type. Note that as of XACML 1.1 the XPathVersion element
 is required in any policy that uses a selector, so if the
 xpathVersion string is null, then this will throw
 an exception.
root - the root of the DOM tree for the XML AttributeSelectorType
             XML typexpathVersion - the XPath version to use, or null if this is
                     unspecified (ie, not supplied in the defaults
                     section of the policy)
AttributeSelector
ParsingException - if the AttributeSelectorType was invalidpublic URI getType()
getType in interface Evaluatablepublic String getContextPath()
public boolean mustBePresent()
public boolean evaluatesToBag()
evaluatesToBag in interface Evaluatablepublic List getChildren()
getChildren in interface EvaluatableListpublic String getXPathVersion()
public EvaluationResult evaluate(EvaluationCtx context)
AttributeFinder used by the given
 EvaluationCtx to try to resolve an attribute value. If
 the selector is defined with MustBePresent as true, then failure
 to find a matching value will result in Indeterminate, otherwise it
 will result in an empty bag. To support the basic selector
 functionality defined in the XACML specification, use a finder that
 has only the SelectorModule as a module that supports
 selector finding.
evaluate in interface Evaluatablecontext - representation of the request to search
public void encode(OutputStream output)
OutputStream with no
 indentation.
encode in interface Evaluatableoutput - a stream into which the XML-encoded data is written
public void encode(OutputStream output,
                   Indenter indenter)
OutputStream with
 indentation.
encode in interface Evaluatableoutput - a stream into which the XML-encoded data is writtenindenter - an object that creates indentation strings
  | 
Sun's XACML Implementation Version 1.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.