/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: ObligationsImpl.java,v 1.3 2008/11/10 22:57:06 veiming Exp $
*
*/
/**
* The <code>Obligations</code> element is a container of
* one or more <code>Obligation</code>s issuded by
* authorization authority.
* @supported.all.api
*/
/* schema
<xs:element name="Obligations" type="xacml:ObligationsType"/>
<xs:complexType name="ObligationsType">
<xs:sequence>
<xs:element ref="xacml:Obligation" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
*/
private boolean mutable = true;
/**
* Default constructor
*/
public ObligationsImpl() {
}
/**
* Constructs an <code>ObligationsImpl</code> object from an XML string
*
* @param xml string representing an <code>ObligationsImpl</code> object
* @throws XACMLException if the XML string could not be processed
*/
} else {
"ResponseImpl.processElement(): invalid XML input");
throw new XACMLException(
"errorObtainingElement"));
}
}
/**
* Constructs an <code>ObligationsImpl</code> object from an XML DOM element
*
* @param element XML DOM element representing a
* <code>ObligationsImpl</code> object.
*
* @throws SAMLException if the DOM element could not be processed
*/
}
/**
* Returns the <code>Obligation</code> objects set in this
* <code>Obligations</code>
* @return the <code>Obligation</code> objects set in this
* <code>Obligations</code>
*/
return obligations;
}
/**
* Sets the <code>Obligation</code> objects of this
* <code>Obligations</code>
*
* @param obligations the <code>Obligation</code> objects to set in this
* <code>Obligations</code>
* @throws XACMLException if the object is immutable.
*/
if (!mutable) {
throw new XACMLException(
}
if (obligations != null) {
this.obligations = new ArrayList();
}
} else {
obligations = null;
}
}
/**
* Adds an <code>Obligation</code> to this object.
*
* @param obligation the <code>Obligation</code> to add.
* @throws XACMLException if the object is immutable.
*/
if (!mutable) {
throw new XACMLException(
}
if (obligations == null) {
obligations = new ArrayList();
}
}
/**
* Returns a string representation of this object
* @param includeNSPrefix Determines whether or not the namespace qualifier
* is prepended to the Element when converted
* @param declareNS Determines whether or not the namespace is declared
* within the Element.
* @return a string representation
* @exception XACMLException if conversion fails for any reason
*/
throws XACMLException {
if (includeNSPrefix) {
}
if (declareNS) {
}
int length = 0;
if (obligations != null) {
for (int i = 0; i < length; i++) {
}
}
}
/**
* Returns a string representation of this object
*
* @return a string representation
* @exception XACMLException if conversion fails for any reason
*/
return toXMLString(true, false);
}
/**
* Makes this object immutable
*/
public void makeImmutable() {
mutable = false;
}
/**
* Checks if this object is mutable
*
* @return <code>true</code> if the object is mutable,
* <code>false</code> otherwise
*/
public boolean isMutable() {
return mutable;
}
/**
* Initializes a <code>ObligationsImpl</code> object from an XML DOM element
*
* @param element XML DOM element representing a
* <code>ObligationsImpl</code> object
*
* @throws XACMLException if the DOM element could not be processed
*/
"ResponseImpl.processElement(): invalid root element");
throw new XACMLException(
}
"ResponseImpl.processElement(): local name missing");
throw new XACMLException(
"missing_local_name"));
}
"ResponseImpl.processElement: invalid local name " + elemName);
throw new XACMLException(
"invalid_local_name"));
}
// starts processing subelements
int nextElem = 0;
while (nextElem < numOfNodes) {
} else {
"ObligationsImpl.processElement(): "
+ " invalid child element: " + elemName);
throw new XACMLException(
"invalid_child_name"));
}
}
}
nextElem++;
}
}
}