From 52f37f0f24af08aced6e4bdb94821e22ba391cae Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 2 Oct 2018 14:45:08 +0200 Subject: move eID4U module into eID4U git repo --- .../AbstractStringAttributeMarshaller.java | 49 ---------------------- 1 file changed, 49 deletions(-) delete mode 100644 id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/AbstractStringAttributeMarshaller.java (limited to 'id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/AbstractStringAttributeMarshaller.java') 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 { - - @Override - public String marshal(AttributeValue value) throws AttributeValueMarshallingException { - String result = value.getValue(); - - //to validation - if (!hasValidForm(result)) - throw new AttributeValueMarshallingException( - "Illegal " + getName() + " value \"" + result + "\""); - - return result; - } - - @Override - public AttributeValue 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(); - -} -- cgit v1.2.3