Class SchemaValidate.SchemaLocation
- java.lang.Object
- 
- org.apache.tools.ant.taskdefs.optional.SchemaValidate.SchemaLocation
 
- 
- Enclosing class:
- SchemaValidate
 
 public static class SchemaValidate.SchemaLocation extends java.lang.Objectrepresentation of a schema location. This is a URI plus either a file or a url
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringERROR_NO_FILEFile not foundstatic java.lang.StringERROR_NO_LOCATIONNo location providedstatic java.lang.StringERROR_NO_URINo namespace URIstatic java.lang.StringERROR_NO_URL_REPRESENTATIONCannot make URLstatic java.lang.StringERROR_TWO_LOCATIONSBoth URL and File were given for schema
 - 
Constructor SummaryConstructors Constructor Description SchemaLocation()
 - 
Method SummaryModifier and Type Method Description booleanequals(java.lang.Object o)equality test checks namespace, location and filename.java.io.FilegetFile()Get the file.java.lang.StringgetNamespace()Get the namespace.java.lang.StringgetSchemaLocationURL()get the URL of the schemajava.lang.StringgetURIandLocation()validate the fields then create a "uri location" stringjava.lang.StringgetUrl()The URL containing the schema.inthashCode()Generate a hashcode depending on the namespace, url and file name.voidsetFile(java.io.File file)identify a file that contains this namespace's schema.voidsetNamespace(java.lang.String namespace)set the namespace of this schema.voidsetUrl(java.lang.String url)identify a URL that hosts the schema.java.lang.StringtoString()Returns a string representation of the object for error messages and the likevoidvalidateNamespace()assert that a namespace is valid
 
- 
- 
- 
Field Detail- 
ERROR_NO_URIpublic static final java.lang.String ERROR_NO_URI No namespace URI- See Also:
- Constant Field Values
 
 - 
ERROR_TWO_LOCATIONSpublic static final java.lang.String ERROR_TWO_LOCATIONS Both URL and File were given for schema- See Also:
- Constant Field Values
 
 - 
ERROR_NO_FILEpublic static final java.lang.String ERROR_NO_FILE File not found- See Also:
- Constant Field Values
 
 - 
ERROR_NO_URL_REPRESENTATIONpublic static final java.lang.String ERROR_NO_URL_REPRESENTATION Cannot make URL- See Also:
- Constant Field Values
 
 - 
ERROR_NO_LOCATIONpublic static final java.lang.String ERROR_NO_LOCATION No location provided- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getNamespacepublic java.lang.String getNamespace() Get the namespace.- Returns:
- the namespace.
 
 - 
setNamespacepublic void setNamespace(java.lang.String namespace) set the namespace of this schema. Any URI- Parameters:
- namespace- the namespace to use.
 
 - 
getFilepublic java.io.File getFile() Get the file.- Returns:
- the file containing the schema.
 
 - 
setFilepublic void setFile(java.io.File file) identify a file that contains this namespace's schema. The file must exist.- Parameters:
- file- the file contains the schema.
 
 - 
getUrlpublic java.lang.String getUrl() The URL containing the schema.- Returns:
- the URL string.
 
 - 
setUrlpublic void setUrl(java.lang.String url) identify a URL that hosts the schema.- Parameters:
- url- the URL string.
 
 - 
getSchemaLocationURLpublic java.lang.String getSchemaLocationURL() get the URL of the schema- Returns:
- a URL to the schema
- Throws:
- BuildException- if not
 
 - 
getURIandLocationpublic java.lang.String getURIandLocation() throws BuildExceptionvalidate the fields then create a "uri location" string- Returns:
- string of uri and location
- Throws:
- BuildException- if there is an error.
 
 - 
validateNamespacepublic void validateNamespace() assert that a namespace is valid- Throws:
- BuildException- if not
 
 - 
equalspublic boolean equals(java.lang.Object o) equality test checks namespace, location and filename. All must match,- Overrides:
- equalsin class- java.lang.Object
- Parameters:
- o- object to compare against
- Returns:
- true iff the objects are considered equal in value
 
 - 
hashCodepublic int hashCode() Generate a hashcode depending on the namespace, url and file name.- Overrides:
- hashCodein class- java.lang.Object
- Returns:
- the hashcode.
 
 - 
toStringpublic java.lang.String toString() Returns a string representation of the object for error messages and the like- Overrides:
- toStringin class- java.lang.Object
- Returns:
- a string representation of the object.
 
 
- 
 
-