public abstract class PrefixedRootFactory extends Object implements ReferenceFactory
A PrefixedRootFactory defines a set of roots which it can provide references for. Roots can either be a full URI root like "http://", or "file://", or can be local roots like "resource" or "file", in which case the assumed protocol parent will be "jr://".
For example: a PrefixedRootFactory with the roots "media" and "resource" will be used by the ReferenceManager to derive any URI with the roots
jr://media/checkmark.pngand a PrefixedRootFactory with roots "file" and "file://" will be used by the ReferenceManager to derive any URI with the roots
jr://file/myxform.xhtmlor
file://myxform.xhtml
| Constructor and Description |
|---|
PrefixedRootFactory(String[] roots)
Construct a PrefixedRootFactory which handles the roots
provided.
|
| Modifier and Type | Method and Description |
|---|---|
Reference |
derive(String URI) |
Reference |
derive(String URI,
String context) |
boolean |
derives(String URI) |
protected abstract Reference |
factory(String terminal,
String URI)
Creates a Reference using the most locally available part of a
URI.
|
String |
toString() |
public PrefixedRootFactory(String[] roots)
roots - The roots of URI's which should be derived by
this factory.public Reference derive(String URI) throws InvalidReferenceException
derive in interface ReferenceFactoryInvalidReferenceExceptionprotected abstract Reference factory(String terminal, String URI)
terminal - The local part of the URI for this prefixed root
(excluding the root itself)URI - The full URIpublic Reference derive(String URI, String context) throws InvalidReferenceException
derive in interface ReferenceFactoryInvalidReferenceExceptionpublic boolean derives(String URI)
derives in interface ReferenceFactoryCopyright © 2022. All rights reserved.