public class InlineStringToInlineByteTranslator extends Object implements ExternalReferenceTranslatorSPI<InlineStringReference,InlineByteArrayReference>
Constructor and Description |
---|
InlineStringToInlineByteTranslator() |
Modifier and Type | Method and Description |
---|---|
InlineByteArrayReference |
createReference(InlineStringReference sourceReference,
ReferenceContext context)
Given an existing ExternalReferenceSPI, build the appropriate target
ExternalReferenceSPI implementation and return it.
|
Class<InlineStringReference> |
getSourceReferenceType()
Return the type of external reference that this translator consumes.
|
Class<InlineByteArrayReference> |
getTargetReferenceType()
Return the type of external reference this translator constructs.
|
float |
getTranslationCost()
Return an approximate complexity cost of the translation.
|
boolean |
isEnabled(ReferenceContext context)
Because the reference translator may rely on facilities provided to it
through the context this method is available to check whether these
facilities are sufficient.
|
public InlineByteArrayReference createReference(InlineStringReference sourceReference, ReferenceContext context)
ExternalReferenceTranslatorSPI
createReference
in interface ExternalReferenceTranslatorSPI<InlineStringReference,InlineByteArrayReference>
sourceReference
- the reference to be used as source for the translation.context
- a reference resolution context, needed potentially to access
the existing external references or to construct the new one,
especially in cases where the context contains security agents
giving access to a remote data staging systempublic Class<InlineStringReference> getSourceReferenceType()
ExternalReferenceTranslatorSPI
getSourceReferenceType
in interface ExternalReferenceTranslatorSPI<InlineStringReference,InlineByteArrayReference>
public Class<InlineByteArrayReference> getTargetReferenceType()
ExternalReferenceTranslatorSPI
getTargetReferenceType
in interface ExternalReferenceTranslatorSPI<InlineStringReference,InlineByteArrayReference>
public boolean isEnabled(ReferenceContext context)
ExternalReferenceTranslatorSPI
isEnabled
in interface ExternalReferenceTranslatorSPI<InlineStringReference,InlineByteArrayReference>
context
- the reference context that will be used to construct new
references during the translation processpublic float getTranslationCost()
ExternalReferenceTranslatorSPI
getTranslationCost
in interface ExternalReferenceTranslatorSPI<InlineStringReference,InlineByteArrayReference>
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.