Package com.io7m.jxe.core
Class JXESchemaDefinition
- java.lang.Object
-
- com.io7m.jxe.core.JXESchemaDefinition
-
- All Implemented Interfaces:
JXESchemaDefinitionType
public final class JXESchemaDefinition extends java.lang.Object implements JXESchemaDefinitionType
The type of schema definitions. A schema definition is typically used with aJXEHardenedDispatchingResolverto resolve schemas from internal Java resources. When an XML parser is required to locate the XSD schema for a namespacen, it consults the map of schema definitions and, if a schema exists with the given namespace URI, passes thefileIdentifier()to the dispatching resolver which then uses that identifier to openlocation().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJXESchemaDefinition.BuilderBuilds instances of typeJXESchemaDefinition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JXESchemaDefinition.Builderbuilder()Creates a builder forJXESchemaDefinition.static JXESchemaDefinitioncopyOf(JXESchemaDefinitionType instance)Creates an immutable copy of aJXESchemaDefinitionTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofJXESchemaDefinitionthat have equal attribute values.java.lang.StringfileIdentifier()inthashCode()Computes a hash code from attributes:namespace,fileIdentifier.java.net.URLlocation()java.net.URInamespace()static JXESchemaDefinitionof(java.net.URI namespace, java.lang.String fileIdentifier, java.net.URL location)Construct a new immutableJXESchemaDefinitioninstance.java.lang.StringtoString()Prints the immutable valueJXESchemaDefinitionwith attribute values.JXESchemaDefinitionwithFileIdentifier(java.lang.String value)Copy the current immutable object by setting a value for thefileIdentifierattribute.JXESchemaDefinitionwithLocation(java.net.URL value)Copy the current immutable object by setting a value for thelocationattribute.JXESchemaDefinitionwithNamespace(java.net.URI value)Copy the current immutable object by setting a value for thenamespaceattribute.
-
-
-
Method Detail
-
namespace
public java.net.URI namespace()
- Specified by:
namespacein interfaceJXESchemaDefinitionType- Returns:
- The schema namespace URI
-
fileIdentifier
public java.lang.String fileIdentifier()
- Specified by:
fileIdentifierin interfaceJXESchemaDefinitionType- Returns:
- The file identifier used to load the schema
-
location
public java.net.URL location()
- Specified by:
locationin interfaceJXESchemaDefinitionType- Returns:
- The schema location
-
withNamespace
public final JXESchemaDefinition withNamespace(java.net.URI value)
Copy the current immutable object by setting a value for thenamespaceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for namespace- Returns:
- A modified copy of the
thisobject
-
withFileIdentifier
public final JXESchemaDefinition withFileIdentifier(java.lang.String value)
Copy the current immutable object by setting a value for thefileIdentifierattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for fileIdentifier- Returns:
- A modified copy of the
thisobject
-
withLocation
public final JXESchemaDefinition withLocation(java.net.URL value)
Copy the current immutable object by setting a value for thelocationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for location- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofJXESchemaDefinitionthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:namespace,fileIdentifier.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueJXESchemaDefinitionwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static JXESchemaDefinition of(java.net.URI namespace, java.lang.String fileIdentifier, java.net.URL location)
Construct a new immutableJXESchemaDefinitioninstance.- Parameters:
namespace- The value for thenamespaceattributefileIdentifier- The value for thefileIdentifierattributelocation- The value for thelocationattribute- Returns:
- An immutable JXESchemaDefinition instance
-
copyOf
public static JXESchemaDefinition copyOf(JXESchemaDefinitionType instance)
Creates an immutable copy of aJXESchemaDefinitionTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable JXESchemaDefinition instance
-
builder
public static JXESchemaDefinition.Builder builder()
Creates a builder forJXESchemaDefinition.- Returns:
- A new JXESchemaDefinition builder
-
-