[java-identity-provider COMMIT] in /trunk: idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttribute...

noreply at shibboleth.net noreply at shibboleth.net
Fri Dec 19 18:03:22 EST 2014


Author: scantor
Date: Fri Dec 19 18:03:20 2014
New Revision: 7190

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7190&view=rev
Log:
IDP-548 - IdPAttributeValue should expose a display value 

Modified:
    trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttributeValue.java
    trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttributeValue.java
    trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ScopedStringAttributeValue.java
    trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/StringAttributeValue.java
    trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/XMLObjectAttributeValue.java
    trunk/idp-conf/src/main/resources/views/intercept/attribute-release.vm

Modified: trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttributeValue.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttributeValue.java?rev=7190&r1=7189&r2=7190&view=diff
==============================================================================
--- trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttributeValue.java (original)
+++ trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttributeValue.java Fri Dec 19 18:03:20 2014
@@ -22,6 +22,7 @@
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.codec.Base64Support;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
@@ -41,13 +42,19 @@
      * @param attributeValue value of the attribute
      */
     public ByteAttributeValue(@Nonnull final byte[] attributeValue) {
-        value = Constraint.isNotNull(attributeValue, "Attribute value can not be null");
+        value = Constraint.isNotNull(attributeValue, "Attribute value cannot be null");
     }
 
     /** {@inheritDoc} */
     @Override
     public final byte[] getValue() {
         return value;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    @Nonnull @NotEmpty public String getDisplayValue() {
+        return "(binary data)";
     }
 
     /**

Modified: trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttributeValue.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttributeValue.java?rev=7190&r1=7189&r2=7190&view=diff
==============================================================================
--- trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttributeValue.java (original)
+++ trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttributeValue.java Fri Dec 19 18:03:20 2014
@@ -19,9 +19,11 @@
 
 import javax.annotation.Nonnull;
 
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+
 /**
  * Interface for values of an {@link IdPAttribute}. This interface provides an explicit method for getting the value of
- * an attribute as opposed to any other data that may be associated with the value.
+ * an attribute as opposed to any other data that may be associated with the value, as well as a displayable value.
  * <p>
  * Implementations of this interface <strong>MUST</strong> implement an appropriate {@link Object#equals(Object)} and
  * {@link Object#hashCode()} method. They should also implement {@link Object#toString()} such that useful
@@ -33,9 +35,17 @@
 public interface IdPAttributeValue<ValueType> {
 
     /**
-     * Gets the value of this attribute.
+     * Get the value of this attribute.
      * 
      * @return the attribute value
      */
-    @Nonnull public ValueType getValue();
-}
+    @Nonnull ValueType getValue();
+    
+    /**
+     * Get a displayable form of the value for user interfaces and similar purposes.
+     * 
+     * @return  a displayable value
+     */
+    @Nonnull @NotEmpty String getDisplayValue();
+    
+}

Modified: trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ScopedStringAttributeValue.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ScopedStringAttributeValue.java?rev=7190&r1=7189&r2=7190&view=diff
==============================================================================
--- trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ScopedStringAttributeValue.java (original)
+++ trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ScopedStringAttributeValue.java Fri Dec 19 18:03:20 2014
@@ -44,7 +44,7 @@
     public ScopedStringAttributeValue(@Nonnull @NotEmpty final String attributeValue,
             @Nonnull @NotEmpty final String valueScope) {
         super(attributeValue);
-        scope = Constraint.isNotNull(StringSupport.trimOrNull(valueScope), "Scope can not be null or empty");
+        scope = Constraint.isNotNull(StringSupport.trimOrNull(valueScope), "Scope cannot be null or empty");

[... 107 lines stripped ...]


More information about the commits mailing list