From 47ca9c6c93447788376ba53e394ed3116d5a3dcc Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 2 Jul 2018 18:10:21 +0200 Subject: add requested attributes to PVP S-profile --- .../impl/reqattr/EAAFRequestedAttributeImpl.java | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/reqattr/EAAFRequestedAttributeImpl.java (limited to 'eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/reqattr/EAAFRequestedAttributeImpl.java') diff --git a/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/reqattr/EAAFRequestedAttributeImpl.java b/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/reqattr/EAAFRequestedAttributeImpl.java new file mode 100644 index 00000000..a04f6123 --- /dev/null +++ b/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/reqattr/EAAFRequestedAttributeImpl.java @@ -0,0 +1,109 @@ +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); + } + +} -- cgit v1.2.3