Package com.io7m.jxe.core
Class JXESchemaDefinition
java.lang.Object
com.io7m.jxe.core.JXESchemaDefinition
- All Implemented Interfaces:
JXESchemaDefinitionType
The type of schema definitions.
A schema definition is typically used with a
JXEHardenedDispatchingResolver
to
resolve schemas from internal Java resources. When an XML parser is required to
locate the XSD schema for a namespace n
, it consults the map of
schema definitions and, if a schema exists with the given namespace URI,
passes the fileIdentifier()
to the dispatching resolver which then
uses that identifier to open location()
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeJXESchemaDefinition
. -
Method Summary
Modifier and TypeMethodDescriptionstatic JXESchemaDefinition.Builder
builder()
Creates a builder forJXESchemaDefinition
.static JXESchemaDefinition
copyOf
(JXESchemaDefinitionType instance) Creates an immutable copy of aJXESchemaDefinitionType
value.boolean
This instance is equal to all instances ofJXESchemaDefinition
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:namespace
,fileIdentifier
.location()
static JXESchemaDefinition
Construct a new immutableJXESchemaDefinition
instance.toString()
Prints the immutable valueJXESchemaDefinition
with attribute values.final JXESchemaDefinition
withFileIdentifier
(String value) Copy the current immutable object by setting a value for thefileIdentifier
attribute.final JXESchemaDefinition
withLocation
(URL value) Copy the current immutable object by setting a value for thelocation
attribute.final JXESchemaDefinition
withNamespace
(URI value) Copy the current immutable object by setting a value for thenamespace
attribute.
-
Method Details
-
namespace
- Specified by:
namespace
in interfaceJXESchemaDefinitionType
- Returns:
- The schema namespace URI
-
fileIdentifier
- Specified by:
fileIdentifier
in interfaceJXESchemaDefinitionType
- Returns:
- The file identifier used to load the schema
-
location
- Specified by:
location
in interfaceJXESchemaDefinitionType
- Returns:
- The schema location
-
withNamespace
Copy the current immutable object by setting a value for thenamespace
attribute. 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
this
object
-
withFileIdentifier
Copy the current immutable object by setting a value for thefileIdentifier
attribute. 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
this
object
-
withLocation
Copy the current immutable object by setting a value for thelocation
attribute. 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
this
object
-
equals
This instance is equal to all instances ofJXESchemaDefinition
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:namespace
,fileIdentifier
. -
toString
Prints the immutable valueJXESchemaDefinition
with attribute values. -
of
Construct a new immutableJXESchemaDefinition
instance.- Parameters:
namespace
- The value for thenamespace
attributefileIdentifier
- The value for thefileIdentifier
attributelocation
- The value for thelocation
attribute- Returns:
- An immutable JXESchemaDefinition instance
-
copyOf
Creates an immutable copy of aJXESchemaDefinitionType
value. 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
Creates a builder forJXESchemaDefinition
.JXESchemaDefinition.builder() .setNamespace(java.net.URI) // required
namespace
.setFileIdentifier(String) // requiredfileIdentifier
.setLocation(java.net.URL) // requiredlocation
.build();- Returns:
- A new JXESchemaDefinition builder
-