public class DmsSchemaParser extends Object implements DmcUncheckedOIFHandlerIF, SchemaDefinitionListenerIF, DmcNameClashResolverIF
| Constructor and Description |
|---|
DmsSchemaParser(SchemaManager sm,
ConfigFinder f)
Creates a new schema parser.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkRules(SchemaDefinition sd) |
void |
definitionAdded(DmsDefinitionDMO def) |
void |
handleObject(DmcUncheckedObject uco,
String infile,
int lineNumber)
We handle the various schema related objects.
|
SchemaDefinition |
parseSchema(SchemaManager am,
String schemaName,
boolean terse)
Parses the specified DMS file and any other schemas on which it depends.
|
DmcNamedObjectIF |
resolveClash(DmcObject obj,
DmcAttributeInfo ai,
DmcNameClashObjectSet<?> ncos)
The clash resolver will overload this method to attempt to resolve the name clash.
|
public DmsSchemaParser(SchemaManager sm, ConfigFinder f) throws ResultException
sm - A base level schema manager i.e. a newly created SchemaManager.f - A schema finder that has already been called up to find schemas.ResultExceptionpublic SchemaDefinition parseSchema(SchemaManager am, String schemaName, boolean terse) throws ResultException, DmcValueException, DmcRuleExceptionSet, DmcNameClashException
am - A base level manager that will be populated with the schemas we parse. This should
be a newly constructed schema manager.schemaName - The name of the schema. Schema specifications are found in
files with a .dms extension that have been found by the DmsSchemaFinder.terse - If true, only the name of the schema being parsed is displayed
on System.out otherwise, the name of each file being read is printed.ResultExceptionDmcValueExceptionDmcValueExceptionSetDmcRuleExceptionSetDmcNameClashExceptionpublic void checkRules(SchemaDefinition sd) throws DmcRuleExceptionSet, DmcNameClashException, DmcValueException
public void handleObject(DmcUncheckedObject uco, String infile, int lineNumber) throws ResultException, DmcValueException, DmcRuleExceptionSet, DmcNameClashException
handleObject in interface DmcUncheckedOIFHandlerIFuco - The object to be handled.infile - Name of the file from which the object was loaded.lineNumber - The line in the file where the object ended.ResultExceptionDmcValueExceptionDmcRuleExceptionSetDmcNameClashExceptionDmcValueExceptionSetpublic void definitionAdded(DmsDefinitionDMO def)
definitionAdded in interface SchemaDefinitionListenerIFpublic DmcNamedObjectIF resolveClash(DmcObject obj, DmcAttributeInfo ai, DmcNameClashObjectSet<?> ncos) throws DmcValueException
DmcNameClashResolverIFresolveClash in interface DmcNameClashResolverIFobj - the object on which resolveReferences() has been calledai - the info for the attribute being resolvedncos - the objects whose names clashDmcValueException - if the appropriate can't be determinedCopyright © 2023. All rights reserved.