org.apache.james.jdkim.tagvalue
Class TagValue

java.lang.Object
  extended by org.apache.james.jdkim.tagvalue.TagValue
Direct Known Subclasses:
PublicKeyRecordImpl, SignatureRecordImpl

public class TagValue
extends Object

This class handle a tag=value list string as defined by DKIM specification It also supports mandatoryTags and default values as a commodity to subclasses.


Field Summary
protected  Map defaults
           
protected  Set mandatoryTags
           
protected static boolean VALIDATION
           
 
Constructor Summary
TagValue(String data)
           
 
Method Summary
protected  boolean containsTag(String tag)
           
 boolean equals(Object obj)
           
protected  CharSequence getDefault(String key)
           
 Set getTags()
           
protected  CharSequence getValue(String key)
           
 int hashCode()
           
protected  void init()
           
protected  boolean isInListCaseInsensitive(CharSequence hash, List hashes)
           
protected  Map newTagValue()
           
protected  void parse(String data)
          subclasses have to make sure tagValues is initialized during init().
protected  void setValue(String tag, String value)
           
protected  List stringToColonSeparatedList(String h, Pattern pattern)
           
protected  Set tagSet()
           
 String toString()
           
protected  CharSequence trimFWS(CharSequence data, int tStart, int tStop, boolean trimWSP)
           
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

VALIDATION

protected static final boolean VALIDATION
See Also:
Constant Field Values

mandatoryTags

protected Set mandatoryTags

defaults

protected Map defaults
Constructor Detail

TagValue

public TagValue(String data)
Method Detail

tagSet

protected Set tagSet()

containsTag

protected boolean containsTag(String tag)

trimFWS

protected CharSequence trimFWS(CharSequence data,
                               int tStart,
                               int tStop,
                               boolean trimWSP)

newTagValue

protected Map newTagValue()

init

protected void init()

parse

protected void parse(String data)
subclasses have to make sure tagValues is initialized during init().

Parameters:
data - the string to be parsed

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getTags

public Set getTags()

getValue

protected CharSequence getValue(String key)

setValue

protected void setValue(String tag,
                        String value)

getDefault

protected CharSequence getDefault(String key)

validate

public void validate()

stringToColonSeparatedList

protected List stringToColonSeparatedList(String h,
                                          Pattern pattern)

isInListCaseInsensitive

protected boolean isInListCaseInsensitive(CharSequence hash,
                                          List hashes)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.