Annotation Interface Namespace


@Inherited @Retention(RUNTIME) @Target({PACKAGE,TYPE}) public @interface Namespace
Namespace declaration allows the use of shorter notation for long URIs.

Namespace can be declared on package and class level. Class-level declaration overrides package-level namespace declaration (in case the prefix is the same).

See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Fully qualified namespace URI, which is mapped by prefix().
    Prefix to be used as a shorthand for the fully qualified namespace URI.
  • Element Details

    • prefix

      String prefix
      Prefix to be used as a shorthand for the fully qualified namespace URI.

      Corresponds to xsd in the xmlns:xsd="http://www.w3.org/2001/XMLSchema#" XML namespace declaration.

      Returns:
      The prefix to be used to reference a namespace
    • namespace

      String namespace
      Fully qualified namespace URI, which is mapped by prefix().

      Corresponds to http://www.w3.org/2001/XMLSchema# in the xmlns:xsd="http://www.w3.org/2001/XMLSchema#" XML namespace declaration.

      Returns:
      The namespace URI