public interface ValueToReferenceConverterSPI
ReferenceService#register(Object, int, boolean)to map arbitrary objects to ExternalReferenceSPI instances if encountered during the registration process. This SPI is only used if the boolean useConverterSPI parameter is set to true on that method.
|Modifier and Type||Method and Description|
Can this SPI implementation convert the specified object to an ExternalReferenceSPI? This test should be as lightweight as possible, and will usually be based on the Class of the object supplied.
Construct and return a new ExternalReferenceSPI implementation which is in some way equivalent to the supplied object.
boolean canConvert(Object o, ReferenceContext context)
context- a ReferenceContext to use if required by the plugin, the ability to convert should be interpreted in the scope of this context. In general the context probably not used by most implementations but it's here if required.
ExternalReferenceSPI convert(Object o, ReferenceContext context) throws ValueToReferenceConversionException
context- a ReferenceContext to use, if required, during construction of the new external reference
ValueToReferenceConversionException- if any problem occurs during the conversion
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.