SunTM's XACML Implementation for JavaTM

com.sun.xacml.ctx
Class Attribute

java.lang.Object
  extended bycom.sun.xacml.ctx.Attribute

public class Attribute
extends Object

Represents the AttributeType XML type found in the context schema.

Since:
1.0

Constructor Summary
Attribute(URI id, String issuer, DateTimeAttribute issueInstant, AttributeValue value)
          Creates a new Attribute of the type specified in the given AttributeValue.
Attribute(URI id, URI type, String issuer, DateTimeAttribute issueInstant, AttributeValue value)
          Deprecated. As of version 1.1, replaced by Attribute(URI,String,DateTimeAttribute,AttributeValue). This constructor has some ambiguity in that it allows a specified datatype and a value that already has some associated datatype. The new constructor clarifies this issue by removing the datatype parameter and using the datatype specified by the given value.
 
Method Summary
 String encode()
          Simple encoding method that returns the text-encoded version of this attribute with no formatting.
 void encode(OutputStream output)
          Encodes this attribute into its XML representation and writes this encoding to the given OutputStream with no indentation.
 void encode(OutputStream output, Indenter indenter)
          Encodes this attribute into its XML representation and writes this encoding to the given OutputStream with indentation.
 URI getId()
          Returns the id of this attribute
static Attribute getInstance(Node root)
          Creates an instance of an Attribute based on the root DOM node of the XML data.
 DateTimeAttribute getIssueInstant()
          Returns the moment at which the attribute was issued, or null if no issue time was provided
 String getIssuer()
          Returns the issuer of this attribute, or null if no issuer was named
 URI getType()
          Returns the data type of this attribute
 AttributeValue getValue()
          The value of this attribute, or null if no value was included
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(URI id,
                 String issuer,
                 DateTimeAttribute issueInstant,
                 AttributeValue value)
Creates a new Attribute of the type specified in the given AttributeValue.

Parameters:
id - the id of the attribute
issuer - the attribute's issuer or null if there is none
issueInstant - the moment when the attribute was issued, or null if it's unspecified
value - the actual value associated with the attribute meta-data

Attribute

public Attribute(URI id,
                 URI type,
                 String issuer,
                 DateTimeAttribute issueInstant,
                 AttributeValue value)
Deprecated. As of version 1.1, replaced by Attribute(URI,String,DateTimeAttribute,AttributeValue). This constructor has some ambiguity in that it allows a specified datatype and a value that already has some associated datatype. The new constructor clarifies this issue by removing the datatype parameter and using the datatype specified by the given value.

Creates a new Attribute

Parameters:
id - the id of the attribute
type - the type of the attribute
issuer - the attribute's issuer or null if there is none
issueInstant - the moment when the attribute was issued, or null if it's unspecified
value - the actual value associated with the attribute meta-data
Method Detail

getInstance

public static Attribute getInstance(Node root)
                             throws ParsingException
Creates an instance of an Attribute based on the root DOM node of the XML data.

Parameters:
root - the DOM root of the AttributeType XML type
Returns:
the attribute throws ParsingException if the data is invalid
Throws:
ParsingException

getId

public URI getId()
Returns the id of this attribute

Returns:
the attribute id

getType

public URI getType()
Returns the data type of this attribute

Returns:
the attribute's data type

getIssuer

public String getIssuer()
Returns the issuer of this attribute, or null if no issuer was named

Returns:
the issuer or null

getIssueInstant

public DateTimeAttribute getIssueInstant()
Returns the moment at which the attribute was issued, or null if no issue time was provided

Returns:
the time of issuance or null

getValue

public AttributeValue getValue()
The value of this attribute, or null if no value was included

Returns:
the attribute's value or null

encode

public void encode(OutputStream output)
Encodes this attribute 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 attribute 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

encode

public String encode()
Simple encoding method that returns the text-encoded version of this attribute with no formatting.

Returns:
the text-encoded XML

Sun's XACML Implementation Version 1.2

Copyright 2003-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.