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 classBuilds instances of typeJXESchemaDefinition. -
Method Summary
Modifier and TypeMethodDescriptionstatic JXESchemaDefinition.Builderbuilder()Creates a builder forJXESchemaDefinition.static JXESchemaDefinitioncopyOf(JXESchemaDefinitionType instance) Creates an immutable copy of aJXESchemaDefinitionTypevalue.booleanThis instance is equal to all instances ofJXESchemaDefinitionthat have equal attribute values.inthashCode()Computes a hash code from attributes:namespace,fileIdentifier.location()static JXESchemaDefinitionConstruct a new immutableJXESchemaDefinitioninstance.toString()Prints the immutable valueJXESchemaDefinitionwith attribute values.final JXESchemaDefinitionwithFileIdentifier(String value) Copy the current immutable object by setting a value for thefileIdentifierattribute.final JXESchemaDefinitionwithLocation(URL value) Copy the current immutable object by setting a value for thelocationattribute.final JXESchemaDefinitionwithNamespace(URI value) Copy the current immutable object by setting a value for thenamespaceattribute.
-
Method Details
-
namespace
- Specified by:
namespacein interfaceJXESchemaDefinitionType- Returns:
- The schema namespace URI
-
fileIdentifier
- Specified by:
fileIdentifierin interfaceJXESchemaDefinitionType- Returns:
- The file identifier used to load the schema
-
location
- Specified by:
locationin interfaceJXESchemaDefinitionType- Returns:
- The schema location
-
withNamespace
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
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
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
This instance is equal to all instances ofJXESchemaDefinitionthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:namespace,fileIdentifier. -
toString
Prints the immutable valueJXESchemaDefinitionwith attribute values. -
of
Construct a new immutableJXESchemaDefinitioninstance.- Parameters:
namespace- The value for thenamespaceattributefileIdentifier- The value for thefileIdentifierattributelocation- The value for thelocationattribute- Returns:
- An immutable JXESchemaDefinition instance
-
copyOf
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
Creates a builder forJXESchemaDefinition.JXESchemaDefinition.builder() .setNamespace(java.net.URI) // requirednamespace.setFileIdentifier(String) // requiredfileIdentifier.setLocation(java.net.URL) // requiredlocation.build();- Returns:
- A new JXESchemaDefinition builder
-