That convinces me that in the case we took in consideration, we don't
need annotations any more ;)
Going to bed, good night!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Jul 8, 2010 at 10:03 PM,  <[email protected]> wrote:
> Author: simonetripodi
> Date: Thu Jul  8 20:03:10 2010
> New Revision: 961912
>
> URL: http://svn.apache.org/viewvc?rev=961912&view=rev
> Log:
> adding metadata to OAuthParameter, such if it is optional or if it is 
> required in the base string calculation
>
> Modified:
>    
> incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthParameter.java
>
> Modified: 
> incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthParameter.java
> URL: 
> http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthParameter.java?rev=961912&r1=961911&r2=961912&view=diff
> ==============================================================================
> --- 
> incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthParameter.java
>  (original)
> +++ 
> incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthParameter.java
>  Thu Jul  8 20:03:10 2010
> @@ -71,7 +71,7 @@ public enum OAuthParameter {
>      *
>      * Value: {...@code oauth_timestamp}.
>      */
> -    TIMESTAMP("oauth_timestamp"),
> +    TIMESTAMP("oauth_timestamp", true, false),
>
>     /**
>      * The token parameter name.
> @@ -105,18 +105,36 @@ public enum OAuthParameter {
>      *
>      * @see org.apache.amber.Version
>      */
> -    VERSION("oauth_version");
> +    VERSION("oauth_version", false, false);
>
>     private final String label;
>
> +    private final boolean optional;
> +
> +    private final boolean includeInSignature;
> +
>     private OAuthParameter(String label) {
> +        this(label, false, true);
> +    }
> +
> +    private OAuthParameter(String label, boolean optional, boolean 
> includeInSignature) {
>         this.label = label;
> +        this.optional = optional;
> +        this.includeInSignature = includeInSignature;
>     }
>
>     public String getLabel() {
>         return this.label;
>     }
>
> +    public boolean isOptional() {
> +        return this.optional;
> +    }
> +
> +    public boolean isIncludeInSignature() {
> +        return this.includeInSignature;
> +    }
> +
>     @Override
>     public String toString() {
>         return this.label;
>
>
>

Reply via email to