Class MetadataFieldName

java.lang.Object
org.dspace.content.MetadataFieldName

public class MetadataFieldName extends Object
Simple immutable holder for the name of a metadata field.
Author:
mwood
  • Field Details

    • schema

      public final String schema
      Name of the metadata schema which defines this field. Never null.
    • element

      public final String element
      Element name of this field. Never null.
    • qualifier

      public final String qualifier
      Qualifier name of this field. May be null.
  • Constructor Details

    • MetadataFieldName

      public MetadataFieldName(@Nonnull String schema, @Nonnull String element, String qualifier)
      Initialize a tuple of (schema, element, qualifier) to name a metadata field.
      Parameters:
      schema - name (not URI) of the schema. Cannot be null.
      element - element name of the field. Cannot be null.
      qualifier - qualifier name of the field.
    • MetadataFieldName

      public MetadataFieldName(@Nonnull String schema, @Nonnull String element)
      Initialize a tuple of (schema, element, qualifier=null) to name a metadata field.
      Parameters:
      schema - name (not URI) of the schema. Cannot be null.
      element - element name of the field. Cannot be null.
    • MetadataFieldName

      public MetadataFieldName(@Nonnull MetadataSchemaEnum schema, @Nonnull String element, String qualifier)
      Initialize a tuple of (schema, element, qualifier) to name a metadata field.
      Parameters:
      schema - name (not URI) of the schema. Cannot be null.
      element - element name of the field. Cannot be null.
      qualifier - qualifier name of the field.
    • MetadataFieldName

      public MetadataFieldName(@Nonnull MetadataSchemaEnum schema, @Nonnull String element)
      Initialize a tuple of (schema, element, qualifier=null) to name a metadata field.
      Parameters:
      schema - name (not URI) of the schema. Cannot be null.
      element - element name of the field. Cannot be null.
    • MetadataFieldName

      public MetadataFieldName(@Nonnull String name)
      Initialize a tuple of (schema, element, qualifier) to name a metadata field.
      Parameters:
      name - a dotted-triple schema.element[.qualifier]. If the optional qualifier is omitted, it will be stored as null.
  • Method Details

    • parse

      public static String[] parse(@Nonnull String name)
      Split a dotted-triple field name schema.element[.qualifier] into its components.
      Parameters:
      name - the dotted-triple field name.
      Returns:
      the components. Always of size 3. If the qualifier is omitted, the third element is null.
      Throws:
      IllegalArgumentException - if there are not at least two components.
      NullPointerException - if name is null.
    • toString

      public String toString()
      Format a dotted-atoms representation of this field name.
      Overrides:
      toString in class Object
      Returns:
      schema.element.qualifier