public static class Path.HintedTypeProvider extends Object implements Path.TypeProvider
Path.TypeProvider) implementation that tries
to deduce the types on the path based on the current position and the intended type of the final segment of
the path.| Constructor and Description |
|---|
HintedTypeProvider(Class<?> intendedFinalType,
Path.Extender extender)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Path.Segment |
deduceSegment(String type,
String id,
boolean isLast)
This is called during parsing of a single segment when the built-in defaults cannot determine the type and
id to use for segment.
|
void |
finished()
Called when the parsing of the path finishes (either successfully or unsuccessfully).
|
void |
segmentParsed(Path.Segment segment)
This method gets called during the parsing process after a segment is successfully parsed.
|
public HintedTypeProvider(Class<?> intendedFinalType, Path.Extender extender)
intendedFinalType - the anticipated type of the final segmentextender - an initial pathpublic void segmentParsed(Path.Segment segment)
Path.TypeProvidersegmentParsed in interface Path.TypeProvidersegment - the segment parsedpublic Path.Segment deduceSegment(String type, String id, boolean isLast)
Path.TypeProviderIf this method returns null, the parsing of the path will fail with an IllegalArgumentException.
deduceSegment in interface Path.TypeProvidertype - the parsed type nameid - the parsed idisLast - true if the parsed segment is the last in the pathpublic void finished()
Path.TypeProviderfinished in interface Path.TypeProviderCopyright © 2015 Red Hat, Inc.. All rights reserved.