public interface ISource
A descriptor that identifies where a given constraint was defined.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe relative location of the source. -
Method Summary
Modifier and TypeMethodDescriptionstatic ISourceexternalSource(StaticContext staticContext, boolean useCached) Get the descriptor for aISource.SourceLocation.EXTERNALsource with as associated resource.static ISourceexternalSource(String location) Get the descriptor for aISource.SourceLocation.EXTERNALsource for the provided resource.static ISourceexternalSource(URI location) Get the descriptor for aISource.SourceLocation.EXTERNALsource for the provided resource.Get a hint about where the source is location.Get the resource where the constraint was defined, if known.Get the type of source.Get the static Metapath context to use when compiling Metapath expressions.static ISourcemoduleSource(IModule module) Get the descriptor for aISource.SourceLocation.MODELsource with as associated resource.
-
Method Details
-
moduleSource
Get the descriptor for aISource.SourceLocation.MODELsource with as associated resource.- Parameters:
module- the Metaschema module the constraint was defined in- Returns:
- the source descriptor
- Since:
- 2.0.0
-
externalSource
Get the descriptor for aISource.SourceLocation.EXTERNALsource for the provided resource.- Parameters:
location- the resource used as the source- Returns:
- the source descriptor
-
externalSource
Get the descriptor for aISource.SourceLocation.EXTERNALsource for the provided resource.- Parameters:
location- the resource used as the source- Returns:
- the source descriptor
-
externalSource
Get the descriptor for aISource.SourceLocation.EXTERNALsource with as associated resource.The provided static context idenfies the location of this source based on the
StaticContext.getBaseUri()method.- Parameters:
staticContext- the static Metapath context to use for compiling Metapath expressions in this sourceuseCached- iftrueuse a previously cached source, otherwise create a new one- Returns:
- the source descriptor
-
getSourceType
Get the type of source.- Returns:
- the type
-
getSource
Get the resource where the constraint was defined, if known.- Returns:
- the resource or
nullif the resource is not known
-
getLocationHint
Get a hint about where the source is location.This value will typically be a URI or class name.
- Returns:
- the hint
-
getStaticContext
Get the static Metapath context to use when compiling Metapath expressions.- Returns:
- the static Metapath context
-