Class ConstraintLoader
- java.lang.Object
-
- gov.nist.secauto.metaschema.core.model.xml.AbstractLoader<IConstraintSet>
-
- gov.nist.secauto.metaschema.core.model.xml.ConstraintLoader
-
public class ConstraintLoader extends AbstractLoader<IConstraintSet>
Provides methods to load a constraint set expressed in XML.Loaded constraint instances are cached to avoid the need to load them for every use. Any constraint set imported is also loaded and cached automatically.
-
-
Constructor Summary
Constructors Constructor Description ConstraintLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected gov.nist.secauto.metaschema.core.model.xml.xmlbeans.METASCHEMACONSTRAINTSDocument
parseConstraintSet(URI resource)
Parse the provided XML resource as a Metaschema constraints.protected IConstraintSet
parseResource(URI resource, Deque<URI> visitedResources)
Parse the providedresource
.protected List<IScopedContraints>
parseScopedConstraints(gov.nist.secauto.metaschema.core.model.xml.xmlbeans.METASCHEMACONSTRAINTSDocument xmlObject, URI source)
Parse individual constraint definitions from the provided XMLBeans object.-
Methods inherited from class gov.nist.secauto.metaschema.core.model.xml.AbstractLoader
getCachedEntries, getLoadedResources, load, load, load, load, loadInternal
-
-
-
-
Constructor Detail
-
ConstraintLoader
public ConstraintLoader()
-
-
Method Detail
-
parseResource
protected IConstraintSet parseResource(@NonNull URI resource, @NonNull Deque<URI> visitedResources) throws IOException
Description copied from class:AbstractLoader
Parse the providedresource
.- Specified by:
parseResource
in classAbstractLoader<IConstraintSet>
- Parameters:
resource
- the resource to parsevisitedResources
- a stack representing previously parsed resources imported by the providedresource
- Returns:
- the parsed resource
- Throws:
IOException
- if an error occurred while parsing the resource
-
parseConstraintSet
@NonNull protected gov.nist.secauto.metaschema.core.model.xml.xmlbeans.METASCHEMACONSTRAINTSDocument parseConstraintSet(@NonNull URI resource) throws IOException
Parse the provided XML resource as a Metaschema constraints.- Parameters:
resource
- the resource to parse- Returns:
- the XMLBeans representation of the Metaschema contraints
- Throws:
IOException
- if a parsing error occurred
-
parseScopedConstraints
@NonNull protected List<IScopedContraints> parseScopedConstraints(@NonNull gov.nist.secauto.metaschema.core.model.xml.xmlbeans.METASCHEMACONSTRAINTSDocument xmlObject, @NonNull URI source)
Parse individual constraint definitions from the provided XMLBeans object.- Parameters:
xmlObject
- the XMLBeans objectsource
- the source of the constraint content- Returns:
- the scoped constraint definitions
-
-