/******************************************************************************* * Copyright 2017 Graz University of Technology * EAAF-Core Components has been developed in a cooperation between EGIZ, * A-SIT+, A-SIT, and Graz University of Technology. * * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. *******************************************************************************/ /******************************************************************************* *******************************************************************************/ package at.gv.egiz.eaaf.modules.pvp2.impl.reqattr; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.opensaml.common.impl.AbstractSAMLObject; import org.opensaml.xml.XMLObject; import org.opensaml.xml.schema.XSBooleanValue; import org.opensaml.xml.util.AttributeMap; import org.opensaml.xml.util.XMLObjectChildrenList; import at.gv.egiz.eaaf.modules.pvp2.api.reqattr.EAAFRequestedAttribute; public class EAAFRequestedAttributeImpl extends AbstractSAMLObject implements EAAFRequestedAttribute { private final XMLObjectChildrenList attributeValues; private String friendlyName; private String isRequired; private String name; private String nameFormat; private AttributeMap unknownAttributes; public EAAFRequestedAttributeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) { super(namespaceURI, elementLocalName, namespacePrefix); unknownAttributes = new AttributeMap(this); attributeValues = new XMLObjectChildrenList(this); } public final List getAttributeValues() { return attributeValues; } public final String getFriendlyName() { return friendlyName; } public final String getIsRequiredXSBoolean() { return isRequired; } public final String getName() { return name; } public final String getNameFormat() { return nameFormat; } public final List getOrderedChildren() { final List children = new ArrayList(); children.addAll(attributeValues); return Collections.unmodifiableList(children); } public final AttributeMap getUnknownAttributes() { return unknownAttributes; } public final void setFriendlyName(final String newFriendlyName) { this.friendlyName = prepareForAssignment(this.friendlyName, newFriendlyName); } public final void setIsRequired(final String newIsRequired) { isRequired = prepareForAssignment(this.isRequired, newIsRequired); } public final void setName(final String newName) { this.name = prepareForAssignment(this.name, newName); } public final void setNameFormat(final String newNameFormat) { this.nameFormat = prepareForAssignment(this.nameFormat, newNameFormat); } public final void setUnknownAttributes(final AttributeMap newUnknownAttr) { this.unknownAttributes = newUnknownAttr; } @Override public XSBooleanValue isRequiredXSBoolean() { return XSBooleanValue.valueOf(isRequired); } @Override public void setIsRequired(Boolean aBoolean) { this.isRequired = String.valueOf(aBoolean); } @Override public void setIsRequired(XSBooleanValue xsBooleanValue) { this.isRequired = String.valueOf(xsBooleanValue); } @Override public Boolean isRequired() { return Boolean.parseBoolean(isRequired); } }