|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjects.metadata.AbstractType
de.mguennewig.pobjects.metadata.ScalarType
de.mguennewig.pobjects.metadata.StringType
de.mguennewig.pobjects.metadata.ISRCType
public class ISRCType
Data type for the `International Standard Recording Code' or short `ISRC'.
The `ISRC' consist out of the following sections:
This class does only check the format of an `ISRC' but not whether each section is valid, like in an existing country or registrant.
| Field Summary |
|---|
| 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 | |
|---|---|
ISRCType()
Creates a new ISRC type. |
|
| Method Summary | |
|---|---|
void |
checkSyntax(java.lang.String value)
|
java.lang.String |
formatNative(java.lang.Object value)
Map value from its `native' string representation to its
internal representation based on the type. |
static java.lang.String |
getCountry(java.lang.String isrc)
Returns the ISO 3166-1 alpha-2 country code (2 characters). |
static java.lang.String |
getDesignationCode(java.lang.String isrc)
Returns the designation code of the `ISRC'. |
static java.lang.String |
getRegistrantCode(java.lang.String isrc)
Returns the character alphanumeric registrant code. |
static java.lang.String[] |
getSections(java.lang.String isrc)
Returns the 4 sections of an `ISRC'. |
static java.lang.String |
getYear(java.lang.String isrc)
Returns the last two digits of the year of registration. |
| 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, getDescription, getTypeClass, name, parse, setDescription, setTypeClass |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ISRCType()
| Method Detail |
|---|
public java.lang.String formatNative(java.lang.Object value)
value from its `native' string representation to its
internal representation based on the type.
Any `ISRC' is formated into the form:
<country>-<registrant code>-<year>-<designation code>.
formatNative in interface TypeformatNative in class AbstractTypejava.lang.IllegalArgumentException - if value is not a
valid `ISRC'Type.getJavaClass()
public void checkSyntax(java.lang.String value)
throws PObjSyntaxException
checkSyntax in interface TypecheckSyntax in class StringTypePObjSyntaxExceptionpublic static java.lang.String getCountry(java.lang.String isrc)
java.lang.IllegalArgumentException - if the string is not a valid `ISRC'getSections(String)public static java.lang.String getRegistrantCode(java.lang.String isrc)
java.lang.IllegalArgumentException - if the string is not a valid `ISRC'getSections(String)public static java.lang.String getYear(java.lang.String isrc)
java.lang.IllegalArgumentException - if the string is not a valid `ISRC'getSections(String)public static java.lang.String getDesignationCode(java.lang.String isrc)
java.lang.IllegalArgumentException - if the string is not a valid `ISRC'getSections(String)public static java.lang.String[] getSections(java.lang.String isrc)
java.lang.IllegalArgumentException - if the string is not a valid `ISRC'
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||