xml.parser
Class SchemaMapping.TransformURI
java.lang.Object
xml.parser.SchemaMapping.Mapping
xml.parser.SchemaMapping.TransformURI
- Enclosing class:
- SchemaMapping
public static class SchemaMapping.TransformURI
- extends SchemaMapping.Mapping
URI pattern -> related URL.
The pattern is in glob syntax :
- star matches any sequence of character except slashes
- dot really means a dot.
Any text matched by * is inserted in place of the corresponding *
in the destination pattern
e.g. :
*.xml -> *.xsd
*.xml -> *.rng
|
Method Summary |
SchemaMapping.Mapping |
getMappingForDocument(java.lang.String ignoredPublicId,
java.lang.String url,
java.lang.String ignoredNamespace,
java.lang.String ignoredPrefix,
java.lang.String ignoredLocalName)
iterate over the mappings and return the first hit. |
SchemaMapping.Result |
getSchemaForDocument(java.lang.String ignoredPublicId,
java.lang.String url,
java.lang.String ignoredNamespace,
java.lang.String ignoredPrefix,
java.lang.String ignoredLocalName,
boolean ignored)
TODO: what if pattern is absolute and url is relative ?
TODO: patterns with .. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SchemaMapping.TransformURI
public SchemaMapping.TransformURI(java.net.URI baseURI,
java.lang.String fromPattern,
java.lang.String toPattern)
- Parameters:
baseURI - baseURI to use if resource is relativefromPattern - matched patterntoPattern - result pattern
- Throws:
java.lang.IllegalArgumentException - if pattern is null
getSchemaForDocument
public SchemaMapping.Result getSchemaForDocument(java.lang.String ignoredPublicId,
java.lang.String url,
java.lang.String ignoredNamespace,
java.lang.String ignoredPrefix,
java.lang.String ignoredLocalName,
boolean ignored)
- TODO: what if pattern is absolute and url is relative ?
TODO: patterns with .. won't be correctly resolved
- Specified by:
getSchemaForDocument in class SchemaMapping.Mapping
- Parameters:
ignoredPublicId - public ID of the parsed documenturl - system ID of the parsed documentignoredNamespace - namespace of the root element of the parsed documentignoredPrefix - prefix of the root element of the parsed documentignoredLocalName - localName of the root element of the parsed documentignored - if the schema referenced from a typeId must be returned
- Returns:
- schema URL for given document (and baseURI) or null if not found
getMappingForDocument
public SchemaMapping.Mapping getMappingForDocument(java.lang.String ignoredPublicId,
java.lang.String url,
java.lang.String ignoredNamespace,
java.lang.String ignoredPrefix,
java.lang.String ignoredLocalName)
- Description copied from class:
SchemaMapping.Mapping
- iterate over the mappings and return the first hit.
all the parameters are given the same priority : it's really the ordering
of rules which defines a priority order.
Any of the paremeters can be null.
- Specified by:
getMappingForDocument in class SchemaMapping.Mapping
- Parameters:
ignoredPublicId - public ID of the parsed documenturl - system ID of the parsed documentignoredNamespace - namespace of the root element of the parsed documentignoredPrefix - prefix of the root element of the parsed documentignoredLocalName - localName of the root element of the parsed document
- Returns:
- schema URL for given document (and baseURI) or null if not found
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
- Returns:
- xml serialization