de.mguennewig.pobjects.metadata
Class ISSNType

java.lang.Object
  extended by de.mguennewig.pobjects.metadata.AbstractType
      extended by de.mguennewig.pobjects.metadata.ScalarType
          extended by de.mguennewig.pobjects.metadata.StringType
              extended by de.mguennewig.pobjects.metadata.ISSNType
All Implemented Interfaces:
Type

public final class ISSNType
extends StringType

International Standard Serial Number or short ISSN.

The format of the ISSN is an eight digit number, divided by a hyphen into two four digit numbers. The last digit, which may be 0-9 or an X, is a check digit.

Author:
Michael Günnewig

Field Summary
static int ISSN_LENGTH
           
static java.lang.String ISSN_PATTERN
           
 
Fields inherited from class de.mguennewig.pobjects.metadata.StringType
RESTRICT_TO_ALPHANUM, RESTRICT_TO_ANYTHING, RESTRICT_TO_CHARSET, RESTRICT_TO_NUMERIC, RESTRICT_TO_REGEXP
 
Fields inherited from interface de.mguennewig.pobjects.metadata.Type
CLASS_NAME, TYPE_NAME
 
Constructor Summary
ISSNType()
          Creates a new ISSN type.
ISSNType(int size)
          Creates a new ISSN type.
ISSNType(int size, int restrictTo, java.lang.String pattern, int minLength)
          Creates a new ISSN type.
 
Method Summary
static int checksum(java.lang.String issn)
          Computes the ISSN checksum.
 void checkSyntax(java.lang.String value)
          
 
Methods inherited from class de.mguennewig.pobjects.metadata.StringType
checkConstraints, getErrorMsgKey, getJavaClass, getMaxFieldSize, getMinimumLength, getPattern, getRestrictTo, getSize, parseNative, setParam
 
Methods inherited from class de.mguennewig.pobjects.metadata.ScalarType
addMap, expand, getMap, getResult, getResultInc, isScalar, labelToValue, valueToLabel
 
Methods inherited from class de.mguennewig.pobjects.metadata.AbstractType
format, formatNative, getDescription, getTypeClass, name, parse, setDescription, setTypeClass
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISSN_PATTERN

public static final java.lang.String ISSN_PATTERN
See Also:
Constant Field Values

ISSN_LENGTH

public static final int ISSN_LENGTH
See Also:
Constant Field Values
Constructor Detail

ISSNType

public ISSNType()
Creates a new ISSN type.


ISSNType

public ISSNType(int size)
Creates a new ISSN type.


ISSNType

public ISSNType(int size,
                int restrictTo,
                java.lang.String pattern,
                int minLength)
Creates a new ISSN type.

Method Detail

checksum

public static int checksum(java.lang.String issn)
Computes the ISSN checksum.

This works just like the ISBN checksum, with the slight difference that the weights start at 8 and decrease.


checkSyntax

public void checkSyntax(java.lang.String value)
                 throws PObjSyntaxException

Specified by:
checkSyntax in interface Type
Overrides:
checkSyntax in class StringType
Throws:
PObjSyntaxException