org.wso2.balana.ctx
Class StatusDetail

java.lang.Object
  extended by org.wso2.balana.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
Author:
Seth Proctor

Constructor Summary
StatusDetail(List<MissingAttributeDetail> missingAttributeDetails)
          Constructor that uses a List of MissingAttributeDetails 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
 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.
 List<MissingAttributeDetail> getMissingAttributeDetails()
          Gets List of MissingAttributeDetail elements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusDetail

public StatusDetail(List<MissingAttributeDetail> missingAttributeDetails)
             throws IllegalArgumentException
Constructor that uses a List of MissingAttributeDetails 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:
missingAttributeDetails - a List of MissingAttributeDetails
Throws:
IllegalArgumentException - if there is a problem encoding the MissingAttributeDetails

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

getMissingAttributeDetails

public List<MissingAttributeDetail> getMissingAttributeDetails()
Gets List of MissingAttributeDetail elements

Returns:
a List of MissingAttributeDetail

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


Copyright © 2015 WSO2. All rights reserved.