public class TLcdXLinkExpressionFactory extends Object implements ILcdXLinkExpressionFactory
Implementation of ILcdXLinkExpressionFactory
that is able to resolve
references based on XML ID (i.e. hrefs like '#id') and xpointer expressions. In both cases,
the linked elements have to be inside the document that is being decoded.
This class requires access to the TLcdXMLSchemaBasedMapping
of the decoder. It expects the mapping to be available in the given ILcdXMLDocumentContext
with key SCHEMA_BASED_MAPPING
.
Modifier and Type | Field and Description |
---|---|
static Object |
SCHEMA_BASED_MAPPING
Key by which the mapping context should be available as value in the
ILcdXMLDocumentContext . |
Constructor and Description |
---|
TLcdXLinkExpressionFactory()
Creates a new XLink expression factory.
|
Modifier and Type | Method and Description |
---|---|
ILcdXLinkExpression |
compile(TLcdXLinkSimpleLink aLink,
ILcdXMLDocumentContext aContext)
Compiles a given href attribute into an
ILcdXLinkExpression . |
public static final Object SCHEMA_BASED_MAPPING
ILcdXMLDocumentContext
.public TLcdXLinkExpressionFactory()
public ILcdXLinkExpression compile(TLcdXLinkSimpleLink aLink, ILcdXMLDocumentContext aContext)
ILcdXLinkExpressionFactory
Compiles a given href attribute into an ILcdXLinkExpression
.
This method is typically called during decoding when an xlink:href
attribute is encountered.
If no expression can be created for the given href, null
should
be returned.
compile
in interface ILcdXLinkExpressionFactory
aLink
- the link for which an expression is to be createdaContext
- the document context in which the href is to be evaluated