aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/AbstractStringAttributeMarshaller.java
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2018-10-02 14:45:08 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2018-10-02 14:45:08 +0200
commit52f37f0f24af08aced6e4bdb94821e22ba391cae (patch)
treea1a8f55f3d0c75bc343717e236e91e167eb3f9c8 /id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/AbstractStringAttributeMarshaller.java
parent833533bd77ac8fb423aae4c72ed9dbc0b43c6d72 (diff)
downloadmoa-id-spss-52f37f0f24af08aced6e4bdb94821e22ba391cae.tar.gz
moa-id-spss-52f37f0f24af08aced6e4bdb94821e22ba391cae.tar.bz2
moa-id-spss-52f37f0f24af08aced6e4bdb94821e22ba391cae.zip
move eID4U module into eID4U git repo
Diffstat (limited to 'id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/AbstractStringAttributeMarshaller.java')
-rw-r--r--id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/AbstractStringAttributeMarshaller.java49
1 files changed, 0 insertions, 49 deletions
diff --git a/id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/AbstractStringAttributeMarshaller.java b/id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/AbstractStringAttributeMarshaller.java
deleted file mode 100644
index c5a019aa2..000000000
--- a/id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/AbstractStringAttributeMarshaller.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package at.gv.egiz.eid4u.impl.attributes;
-
-import eu.eidas.auth.commons.attribute.AttributeValue;
-import eu.eidas.auth.commons.attribute.AttributeValueMarshaller;
-import eu.eidas.auth.commons.attribute.AttributeValueMarshallingException;
-import eu.eidas.auth.commons.attribute.impl.StringAttributeValue;
-
-public abstract class AbstractStringAttributeMarshaller implements AttributeValueMarshaller<String> {
-
- @Override
- public String marshal(AttributeValue<String> value) throws AttributeValueMarshallingException {
- String result = value.getValue();
-
- //to validation
- if (!hasValidForm(result))
- throw new AttributeValueMarshallingException(
- "Illegal " + getName() + " value \"" + result + "\"");
-
- return result;
- }
-
- @Override
- public AttributeValue<String> unmarshal(String value, boolean isNonLatinScriptAlternateVersion)
- throws AttributeValueMarshallingException {
-
- //to validation
- if (!hasValidForm(value))
- throw new AttributeValueMarshallingException(
- "Illegal " + getName() + " value \"" + value + "\"");
-
- return new StringAttributeValue(value);
- }
-
- /**
- * Validate a String attribute if required
- *
- * @param value String based attribute value
- * @return true if valid, otherwise false
- */
- abstract protected boolean hasValidForm(String value);
-
- /**
- * Get the name of the attribute mashaller
- *
- * @return
- */
- abstract protected String getName();
-
-}