Interface IModule
-
- All Known Implementing Classes:
AbstractModule
public interface IModule
The API for accessing information about a given Metaschema.A Metaschem module may import another Metaschema module. This import graph can be accessed using
getImportedModules()
.Global scoped Metaschema definitions can be accessed using
getScopedAssemblyDefinitionByName(String)
,getScopedFieldDefinitionByName(String)
, andgetScopedFlagDefinitionByName(String)
. These methods take into consideration the import order to provide the global definitions that are in scope within the given Metschema module.Global scoped definitions exported by this Metaschema module, available for use by importing Metaschema modules, can be accessed using
getExportedAssemblyDefinitions()
,getExportedFieldDefinitions()
, andgetExportedFlagDefinitions()
.Global scoped definitions defined directly within the given Metaschema module can be accessed using
getAssemblyDefinitions()
,getFieldDefinitions()
, andgetFlagDefinitions()
, along with similarly named access methods.
-
-
Field Summary
Fields Modifier and Type Field Description static String
METASCHEMA_XML_NS
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static <DEF extends IDefinition>
Predicate<DEF>allNonLocalDefinitions()
Get a filter that will match all definitions that are not locally defined.static <DEF extends IDefinition>
Predicate<DEF>allRootAssemblyDefinitions()
Get a filter that will match all definitions that are root assemblies.default List<? extends IFlagContainer>
getAssemblyAndFieldDefinitions()
Retrieves the top-level assembly and field definitions in this Metaschema module.IAssemblyDefinition
getAssemblyDefinitionByName(String name)
Retrieves the top-level assembly definition in this Metaschema module with the matching name, if it exists.Collection<? extends IAssemblyDefinition>
getAssemblyDefinitions()
Retrieves the top-level assembly definitions in this Metaschema module.IAssemblyDefinition
getExportedAssemblyDefinitionByName(String name)
Retrieves the exported named assembly definition, if it exists.Collection<? extends IAssemblyDefinition>
getExportedAssemblyDefinitions()
Retrieve the top-level assembly definitions that are marked global in this Metaschema module or in any imported Metaschema module.IFieldDefinition
getExportedFieldDefinitionByName(String name)
Retrieves the exported named field definition, if it exists.Collection<? extends IFieldDefinition>
getExportedFieldDefinitions()
Retrieve the top-level field definitions that are marked global in this Metaschema module or in any imported Metaschema module.IFlagDefinition
getExportedFlagDefinitionByName(String name)
Retrieves the exported named flag definition, if it exists.Collection<? extends IFlagDefinition>
getExportedFlagDefinitions()
Retrieve the top-level flag definitions that are marked global in this Metaschema module or in any imported Metaschema modules.default Collection<? extends IAssemblyDefinition>
getExportedRootAssemblyDefinitions()
Retrieves the top-level assembly definitions that are marked as roots from the current Metaschema module and any imported Metaschema modules.IFieldDefinition
getFieldDefinitionByName(String name)
Retrieves the top-level field definition in this Metaschema module with the matching name, if it exists.Collection<? extends IFieldDefinition>
getFieldDefinitions()
Retrieves the top-level field definitions in this Metaschema module.IFlagDefinition
getFlagDefinitionByName(String name)
Retrieves the top-level flag definition in this Metaschema module with the matching name, if it exists.Collection<? extends IFlagDefinition>
getFlagDefinitions()
Retrieves the top-level flag definitions in this Metaschema module.IModule
getImportedModuleByShortName(String name)
Retrieve the imported Metaschema module with the specified name, if it exists.List<? extends IModule>
getImportedModules()
Retrieves all Metaschema modules imported by this Metaschema module.URI
getJsonBaseUri()
Retrieve the JSON schema base URI associated with the Metaschema module.URI
getLocation()
Retrieves the location where the Metaschema module was loaded from.MarkupLine
getName()
Get the long name for the Metaschema module.default QName
getQName()
Get the qualified name associated with the Metaschema module.MarkupMultiline
getRemarks()
Retrieve the remarks associated with this Metaschema module, if any.default Collection<? extends IAssemblyDefinition>
getRootAssemblyDefinitions()
Retrieves the top-level assembly definitions that are marked as roots from the current Metaschema module.default IAssemblyDefinition
getScopedAssemblyDefinitionByName(String name)
Retrieves the assembly definition with a matching name from either: 1) the top-level assembly definitions from this Metaschema module, or 2) global assembly definitions from each imported Metaschema module in reverse order of import.default IFieldDefinition
getScopedFieldDefinitionByName(String name)
Retrieves the field definition with a matching name from either: 1) the top-level field definitions from this Metaschema module, or 2) global field definitions from each imported Metaschema module in reverse order of import.default IFlagDefinition
getScopedFlagDefinitionByName(String name)
Retrieves the flag definition with a matching name from either: 1) the top-level flag definitions from this Metaschema module, or 2) global flag definitions from each imported Metaschema module in reverse order of import.String
getShortName()
Retrieves the unique short name for the Metaschema module, which provides a textual identifier for the Metaschema module.String
getVersion()
Get the revision of the Metaschema module.URI
getXmlNamespace()
Retrieves the XML namespace associated with the Metaschema module.
-
-
-
Field Detail
-
METASCHEMA_XML_NS
static final String METASCHEMA_XML_NS
- See Also:
- Constant Field Values
-
-
Method Detail
-
allNonLocalDefinitions
static <DEF extends IDefinition> Predicate<DEF> allNonLocalDefinitions()
Get a filter that will match all definitions that are not locally defined.- Type Parameters:
DEF
- the type of definition- Returns:
- a predicate implementing the filter
-
allRootAssemblyDefinitions
static <DEF extends IDefinition> Predicate<DEF> allRootAssemblyDefinitions()
Get a filter that will match all definitions that are root assemblies.- Type Parameters:
DEF
- the type of definition- Returns:
- a predicate implementing the filter
-
getLocation
URI getLocation()
Retrieves the location where the Metaschema module was loaded from.- Returns:
- the location, or
null
if this information is not available
-
getName
@NonNull MarkupLine getName()
Get the long name for the Metaschema module.- Returns:
- the name
-
getVersion
@NonNull String getVersion()
Get the revision of the Metaschema module.- Returns:
- the revision
-
getRemarks
@Nullable MarkupMultiline getRemarks()
Retrieve the remarks associated with this Metaschema module, if any.- Returns:
- the remarks or
null
if no remarks are defined
-
getShortName
@NonNull String getShortName()
Retrieves the unique short name for the Metaschema module, which provides a textual identifier for the Metaschema module.- Returns:
- the short name
-
getXmlNamespace
@NonNull URI getXmlNamespace()
Retrieves the XML namespace associated with the Metaschema module.- Returns:
- a namespace
-
getJsonBaseUri
@NonNull URI getJsonBaseUri()
Retrieve the JSON schema base URI associated with the Metaschema module.- Returns:
- the base URI
-
getQName
default QName getQName()
Get the qualified name associated with the Metaschema module.- Returns:
- the qualified name
-
getImportedModules
@NonNull List<? extends IModule> getImportedModules()
Retrieves all Metaschema modules imported by this Metaschema module.- Returns:
- a list of imported Metaschema modules
-
getImportedModuleByShortName
@Nullable IModule getImportedModuleByShortName(String name)
Retrieve the imported Metaschema module with the specified name, if it exists.- Parameters:
name
- the short name of the Metschema module to retrieve- Returns:
- the imported Metaschema module or
null
if it doesn't exist
-
getAssemblyDefinitions
@NonNull Collection<? extends IAssemblyDefinition> getAssemblyDefinitions()
Retrieves the top-level assembly definitions in this Metaschema module.- Returns:
- the collection of assembly definitions
-
getAssemblyDefinitionByName
@Nullable IAssemblyDefinition getAssemblyDefinitionByName(@NonNull String name)
Retrieves the top-level assembly definition in this Metaschema module with the matching name, if it exists.- Parameters:
name
- the definition name- Returns:
- the matching assembly definition, or
null
if none match
-
getFieldDefinitions
@NonNull Collection<? extends IFieldDefinition> getFieldDefinitions()
Retrieves the top-level field definitions in this Metaschema module.- Returns:
- the collection of field definitions
-
getFieldDefinitionByName
@Nullable IFieldDefinition getFieldDefinitionByName(@NonNull String name)
Retrieves the top-level field definition in this Metaschema module with the matching name, if it exists.- Parameters:
name
- the definition name- Returns:
- the matching field definition, or
null
if none match
-
getAssemblyAndFieldDefinitions
@NonNull default List<? extends IFlagContainer> getAssemblyAndFieldDefinitions()
Retrieves the top-level assembly and field definitions in this Metaschema module.- Returns:
- a listing of assembly and field definitions
-
getFlagDefinitions
@NonNull Collection<? extends IFlagDefinition> getFlagDefinitions()
Retrieves the top-level flag definitions in this Metaschema module.- Returns:
- the collection of flag definitions
-
getFlagDefinitionByName
@Nullable IFlagDefinition getFlagDefinitionByName(@NonNull String name)
Retrieves the top-level flag definition in this Metaschema module with the matching name, if it exists.- Parameters:
name
- the definition name- Returns:
- the matching flag definition, or
null
if none match
-
getScopedAssemblyDefinitionByName
@Nullable default IAssemblyDefinition getScopedAssemblyDefinitionByName(@NonNull String name)
Retrieves the assembly definition with a matching name from either: 1) the top-level assembly definitions from this Metaschema module, or 2) global assembly definitions from each imported Metaschema module in reverse order of import.- Parameters:
name
- the name of the assembly to find- Returns:
- the assembly definition
-
getScopedFieldDefinitionByName
@Nullable default IFieldDefinition getScopedFieldDefinitionByName(@NonNull String name)
Retrieves the field definition with a matching name from either: 1) the top-level field definitions from this Metaschema module, or 2) global field definitions from each imported Metaschema module in reverse order of import.- Parameters:
name
- the name of the field definition to find- Returns:
- the field definition
-
getScopedFlagDefinitionByName
@Nullable default IFlagDefinition getScopedFlagDefinitionByName(@NonNull String name)
Retrieves the flag definition with a matching name from either: 1) the top-level flag definitions from this Metaschema module, or 2) global flag definitions from each imported Metaschema module in reverse order of import.- Parameters:
name
- the name of the flag definition to find- Returns:
- the flag definition
-
getExportedRootAssemblyDefinitions
@NonNull default Collection<? extends IAssemblyDefinition> getExportedRootAssemblyDefinitions()
Retrieves the top-level assembly definitions that are marked as roots from the current Metaschema module and any imported Metaschema modules.- Returns:
- a listing of assembly definitions marked as root
-
getRootAssemblyDefinitions
@NonNull default Collection<? extends IAssemblyDefinition> getRootAssemblyDefinitions()
Retrieves the top-level assembly definitions that are marked as roots from the current Metaschema module.- Returns:
- a listing of assembly definitions marked as root
-
getExportedFlagDefinitions
@NonNull Collection<? extends IFlagDefinition> getExportedFlagDefinitions()
Retrieve the top-level flag definitions that are marked global in this Metaschema module or in any imported Metaschema modules. The resulting collection is built by adding global definitions from each imported Metaschema module in order of import, then adding global definitions from the current Metaschema module. Such a map is built in this way for each imported Metaschema module in the chain. Values for clashing keys will be replaced in this order, giving preference to the "closest" definition.- Returns:
- the collection of exported flag definitions
-
getExportedFlagDefinitionByName
@Nullable IFlagDefinition getExportedFlagDefinitionByName(String name)
Retrieves the exported named flag definition, if it exists.For information about how flag definitions are exported see
getExportedFlagDefinitions()
.- Parameters:
name
- the definition name- Returns:
- the flag definition, or
null
if it doesn't exist.
-
getExportedFieldDefinitions
@NonNull Collection<? extends IFieldDefinition> getExportedFieldDefinitions()
Retrieve the top-level field definitions that are marked global in this Metaschema module or in any imported Metaschema module. The resulting collection is built by adding global definitions from each imported Metaschema module in order of import, then adding global definitions from the current Metaschema module. Such a map is built in this way for each imported Metaschema module in the chain. Values for clashing keys will be replaced in this order, giving preference to the "closest" definition- Returns:
- the collection of exported field definitions
-
getExportedFieldDefinitionByName
@Nullable IFieldDefinition getExportedFieldDefinitionByName(String name)
Retrieves the exported named field definition, if it exists.For information about how field definitions are exported see
getExportedFieldDefinitions()
.- Parameters:
name
- the definition name- Returns:
- the field definition, or
null
if it doesn't exist.
-
getExportedAssemblyDefinitions
@NonNull Collection<? extends IAssemblyDefinition> getExportedAssemblyDefinitions()
Retrieve the top-level assembly definitions that are marked global in this Metaschema module or in any imported Metaschema module. The resulting collection is built by adding global definitions from each imported Metaschema module in order of import, then adding global definitions from the current Metaschema module. This collection is built in this way for each imported Metaschema module in the chain. Items with duplicate names will be replaced in this order, giving preference to the "closest" definition- Returns:
- the collection of exported assembly definitions
-
getExportedAssemblyDefinitionByName
@Nullable IAssemblyDefinition getExportedAssemblyDefinitionByName(String name)
Retrieves the exported named assembly definition, if it exists.For information about how assembly definitions are exported see
getExportedFieldDefinitions()
.- Parameters:
name
- the definition name- Returns:
- the assembly definition, or
null
if it doesn't exist.
-
-