Class SchemaValidate.SchemaLocation

java.lang.Object
org.apache.tools.ant.taskdefs.optional.SchemaValidate.SchemaLocation
Enclosing class:
SchemaValidate

public static class SchemaValidate.SchemaLocation extends Object
representation of a schema location. This is a URI plus either a file or a url
  • Field Details

  • Constructor Details

    • SchemaLocation

      public SchemaLocation()
  • Method Details

    • getNamespace

      public String getNamespace()
      Get the namespace.
      Returns:
      the namespace.
    • setNamespace

      public void setNamespace(String namespace)
      set the namespace of this schema. Any URI
      Parameters:
      namespace - the namespace to use.
    • getFile

      public File getFile()
      Get the file.
      Returns:
      the file containing the schema.
    • setFile

      public void setFile(File file)
      identify a file that contains this namespace's schema. The file must exist.
      Parameters:
      file - the file contains the schema.
    • getUrl

      public String getUrl()
      The URL containing the schema.
      Returns:
      the URL string.
    • setUrl

      public void setUrl(String url)
      identify a URL that hosts the schema.
      Parameters:
      url - the URL string.
    • getSchemaLocationURL

      public String getSchemaLocationURL()
      get the URL of the schema
      Returns:
      a URL to the schema
      Throws:
      BuildException - if not
    • getURIandLocation

      public String getURIandLocation() throws BuildException
      validate the fields then create a "uri location" string
      Returns:
      string of uri and location
      Throws:
      BuildException - if there is an error.
    • validateNamespace

      public void validateNamespace()
      assert that a namespace is valid
      Throws:
      BuildException - if not
    • equals

      public boolean equals(Object o)
      equality test checks namespace, location and filename. All must match,
      Overrides:
      equals in class Object
      Parameters:
      o - object to compare against
      Returns:
      true iff the objects are considered equal in value
    • hashCode

      public int hashCode()
      Generate a hashcode depending on the namespace, url and file name.
      Overrides:
      hashCode in class Object
      Returns:
      the hashcode.
    • toString

      public String toString()
      Returns a string representation of the object for error messages and the like
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.