Interface DefinitionFeatureParser<V,S>
- Type Parameters:
V- feature valueS- source object (like XSOM component, annotation, and so on)
- All Known Subinterfaces:
DefinitionFeatureParser.Marker<X>,DefinitionFeatureParser.NonNull<V,X>
public interface DefinitionFeatureParser<V,S>
Parses a schema definition feature value from the source form (currently, XSD/XSOM) to the real value.
Most of these are annotations: For example, "a:container" annotation is converted to a
Boolean value.
However, more complex features are possible, such as "isAny" feature that is determined by analyzing the complex type
definition, and produces a tri-state information about the presence and kind of "any" content present.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSpecial parser for "marker" boolean values, like `a:container`.static interfaceMarks the parser as always returning a value, and provides appropriate getter method. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanapplicableTo(Object sourceComponent) Returns the value of the definition feature for the given (usually XSOM) source.default VgetValueIfApplicable(@NotNull Object source) default <RS> @NotNull DefinitionFeatureParser<V,RS> restrictToSource(Class<RS> restrictedSourceType) Returns this parser, but restricted to a more specific source type.
-
Method Details
-
getValue
Returns the value of the definition feature for the given (usually XSOM) source. The source is intentionally nullable, because there are situations where this method is called with annotations that are often missing.- Throws:
SchemaException
-
getValueIfApplicable
- Throws:
SchemaException
-
applicableTo
-
restrictToSource
@NotNull default <RS> @NotNull DefinitionFeatureParser<V,RS> restrictToSource(Class<RS> restrictedSourceType) Returns this parser, but restricted to a more specific source type. For example, if original parser takes anyObject(e.g., `XSComponent` or `XSAnnotation`), we may restrict it to take only `XSAnnotation`. This is useful e.g. for annotation-based features.
-