/**
* 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: AttributeDesignator.java,v 1.2 2008/06/25 05:47:31 qcheng Exp $
*
*/
/**
* The <code>AttributeDesignator</code> element identifies an attribute
* name within an attribute namespace. The element is used in an attribute query
* to request that attribute values within a specific namespace be returned.
* @supported.all.api
*/
public class AttributeDesignator {
//_attributeNameSpace type should be URI, for now, define as String
/**
*Default constructor
*/
protected AttributeDesignator() {
}
/**
* Constructs an attribute designator element from an existing XML block.
*
* @param element representing a DOM tree element.
* @exception SAMLException if that there is an error in the sender or
* in the element definition.
*/
// make sure that the input xml block is not null
"AttributeDesignator: Input is null.");
throw new SAMLRequesterException(
}
// Make sure this is an AttributeDesignator.
throw new SAMLRequesterException(
}
// handle attributes
int i = 0;
for (i = 0; i < attrCount; i++) {
"Attribute Name is either null or empty.");
}
throw new SAMLRequesterException(
}
}
}
}
// AttributeName is required
"AttributeName is required attribute");
}
throw new SAMLRequesterException(
}
// AttributeNamespace is required
"AttributeNamespace is required attribute");
}
throw new SAMLRequesterException(
}
// handle the children of AttributeDesignator element
// Since AttributeDesignator does not have any child element_node,
// we will throw exception if we found any such child.
if (nodeCount > 0) {
for (i = 0; i < nodeCount; i++) {
"AttributeDesignator: illegal input!");
}
throw new SAMLRequesterException(
}
}
}
}
/**
* Constructs an instance of <code>AttributeDesignator</code>.
*
* @param name the name of the attribute.
* @param nameSpace the namespace in which <code>AttributeName</code>
* elements are interpreted.
* @exception SAMLException if there is an error in the sender or in the
* element definition.
*/
throws SAMLException {
"AttributeName is required!");
}
throw new SAMLRequesterException(
} else {
}
"AttributeNamespace is required!");
}
throw new SAMLRequesterException(
} else {
}
}
/**
* Returns attribute name from the <code>AttributeDesignator</code>.
*
* @return A String representing the attribute name.
*/
return _attributeName;
}
/**
* Returns attribute name space from the
* <code>AttributeDesignator</code>.
*
* @return A String representing the attribute name space.
*/
return _attributeNameSpace;
}
/**
* Returns a String representation of the
* <code><saml:AttributeDesignator></code> element.
*
* @return A string containing the valid XML for this element.
*/
return (toString(true, false));
}
/**
* Returns a String representation of the
* <code><saml:AttributeDesignator></code> element.
*
* @param includeNS Determines whether or not the namespace qualifier is
* to the Element when converted
* @param declareNS Determines whether or not the namespace is declared
* within the Element.
* @return A string containing the valid XML for this element.
*/
if (includeNS) {
}
if (declareNS) {
}
append("\" />\n");
}
}