Class Tag


  • public class Tag
    extends Object

    Tag defines behaviour for a MARC tag.

    A MARC tag is a three character string used to identify an associated variable field. According to the MARC standard the tag may consist of ASCII numeric characters (decimal integers 0-9) and/or ASCII alphabetic characters (uppercase or lowercase, but not both).

    Author:
    Bas Peters
    • Constructor Detail

      • Tag

        public Tag()
    • Method Detail

      • isValid

        public static boolean isValid​(String tag)

        Returns true if the given value is a valid tag value.

        The method returns true if the tag contains three alphabetic or numeric ASCII graphic characters.

        Note: mixing uppercase and lowercase letters is not validated.

        Parameters:
        tag - the tag name
      • isControlNumberField

        public static boolean isControlNumberField​(String tag)

        Returns true if the tag identifies a control number field.

        The method returns false if the tag does not equals 001.

        Parameters:
        tag - the tag name
        Returns:
        boolean - tag identifies a control number field (true) or not (false)
      • isControlField

        public static boolean isControlField​(String tag)

        Returns true if the tag identifies a control field.

        The method returns false if the tag does not begin with two zero's.

        Parameters:
        tag - the tag name
        Returns:
        boolean - tag identifies a control field (true) or a data field (false)
      • isDataField

        public static boolean isDataField​(String tag)

        Returns true if the tag identifies a data field.

        The method returns false if the tag begins with two zero's.

        Parameters:
        tag - the tag name
        Returns:
        boolean - tag identifies a data field (true) or a control field (false)