JBoss port of sunxacml 2.0.8.Final-redhat-1

org.jboss.security.xacml.sunxacml.cond
Class VariableDefinition

java.lang.Object
  extended by org.jboss.security.xacml.sunxacml.cond.VariableDefinition

public class VariableDefinition
extends Object

This class supports the VariableDefinitionType type introuced in XACML 2.0. It allows a Policy to pre-define any number of expression blocks for general use. Note that it's legal (though not usually useful) to define expressions that don't get referenced within the Policy. It is illegal to have more than one definition with the same identifier within a Policy.

Since:
2.0
Author:
Seth Proctor

Constructor Summary
VariableDefinition(String variableId, Expression expression)
          Creates a new VariableDefinition with the given identifier and expression.
 
Method Summary
 void encode(OutputStream output)
          Encodes this class into its XML representation and writes this encoding to the given OutputStream with no indentation.
 void encode(OutputStream output, Indenter indenter)
          Encodes this class into its XML representation and writes this encoding to the given OutputStream with indentation.
 Expression getExpression()
          Returns the expression provided by this definition.
static VariableDefinition getInstance(Node root, PolicyMetaData metaData, VariableManager manager)
          Returns a new instance of the VariableDefinition class based on a DOM node.
 String getVariableId()
          Returns the identifier for this definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableDefinition

public VariableDefinition(String variableId,
                          Expression expression)
Creates a new VariableDefinition with the given identifier and expression.

Parameters:
variableId - the identifier for this definition
expression - the expression defined here
Method Detail

getInstance

public static VariableDefinition getInstance(Node root,
                                             PolicyMetaData metaData,
                                             VariableManager manager)
                                      throws ParsingException
Returns a new instance of the VariableDefinition class based on a DOM node. The node must be the root of an XML VariableDefinitionType.

Parameters:
root - the DOM root of a VariableDefinitionType XML type
metaData - the meta-data associated with the containing policy
manager - VariableManager used to connect references to this definition
Throws:
ParsingException - if the VariableDefinitionType is invalid

getVariableId

public String getVariableId()
Returns the identifier for this definition.

Returns:
the definition's identifier

getExpression

public Expression getExpression()
Returns the expression provided by this definition.

Returns:
the definition's expression

encode

public void encode(OutputStream output)
Encodes this class into its XML representation and writes this encoding to the given OutputStream with no indentation.

Parameters:
output - a stream into which the XML-encoded data is written

encode

public void encode(OutputStream output,
                   Indenter indenter)
Encodes this class into its XML representation and writes this encoding to the given OutputStream with indentation.

Parameters:
output - a stream into which the XML-encoded data is written
indenter - an object that creates indentation strings

JBoss port of sunxacml 2.0.8.Final-redhat-1

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.