SunTM's XACML Implementation for JavaTM

com.sun.xacml.ctx
Class StatusDetail

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

public class StatusDetail
extends Object

This class represents the StatusDetailType in the context schema. Because status detail is defined as a sequence of xs:any XML type, the data in this class must be generic, and it is up to the application developer to interpret the data appropriately.

Since:
1.0

Constructor Summary
StatusDetail(List attributes)
          Constructor that uses a List of Attributes to define the status detail.
StatusDetail(String encoded)
          Constructor that takes the text-encoded form of the XML to use as the status data.
 
Method Summary
 Node getDetail()
          Returns the StatusDetailType DOM root node.
 String getEncoded()
          Returns the text-encoded version of this data, if possible.
static StatusDetail getInstance(Node root)
          Creates an instance of a StatusDetail object based on the given DOM root node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusDetail

public StatusDetail(List attributes)
             throws IllegalArgumentException
Constructor that uses a List of Attributes to define the status detail. This is a common form of detail data, and can be used for things like providing the information included with the missing-attribute status code.

Parameters:
attributes - a List of Attributes
Throws:
IllegalArgumentException - if there is a problem encoding the Attributes

StatusDetail

public StatusDetail(String encoded)
             throws ParsingException
Constructor that takes the text-encoded form of the XML to use as the status data. The encoded text will be wrapped with the StatusDetail XML tag, and the resulting text must be valid XML or a ParsingException will be thrown.

Parameters:
encoded - a non-null String that encodes the status detail
Throws:
ParsingException - if the encoded text is invalid XML
Method Detail

getInstance

public static StatusDetail getInstance(Node root)
                                throws ParsingException
Creates an instance of a StatusDetail object based on the given DOM root node. The node must be a valid StatusDetailType root, or else a ParsingException is thrown.

Parameters:
root - the DOM root of the StatusDetailType XML type
Returns:
a new StatusDetail object
Throws:
ParsingException - if the root node is invalid

getDetail

public Node getDetail()
Returns the StatusDetailType DOM root node. This may contain within it any type of valid XML data, and it is up to the application writer to handle the data accordingly. One common use of status data is to include Attributes, which can be created from their root DOM nodes using their getInstance method.

Returns:
the DOM root for the StatusDetailType XML type

getEncoded

public String getEncoded()
                  throws IllegalStateException
Returns the text-encoded version of this data, if possible. If the String form constructor was used, this will just be the original text wrapped with the StatusData tag. If the List form constructor was used, it will be the encoded attribute data. If this was created using the getInstance method, then getEncoded will throw an exception.

Returns:
the encoded form of this data
Throws:
IllegalStateException - if this object was created using the getInstance method

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.