public class UrlToHttpReference extends Object implements ValueToReferenceConverterSPI
Constructor and Description |
---|
UrlToHttpReference() |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(Object o,
ReferenceContext context)
Can convert if the object is an instance of java.net.URL and the protocol
is HTTP
|
ExternalReferenceSPI |
convert(Object o,
ReferenceContext context)
Return a new HttpReference constructed from
((URL)o).toExternalForm() |
public boolean canConvert(Object o, ReferenceContext context)
canConvert
in interface ValueToReferenceConverterSPI
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.public ExternalReferenceSPI convert(Object o, ReferenceContext context) throws ValueToReferenceConversionException
((URL)o).toExternalForm()
convert
in interface ValueToReferenceConverterSPI
context
- a ReferenceContext to use, if required, during construction of
the new external referenceValueToReferenceConversionException
- if any problem occurs during the conversionCopyright © 2015–2016 The Apache Software Foundation. All rights reserved.