/** @packageDocumentation * @module Validation */ import { AnyClass, AnyProperty, Constant, CustomAttribute, CustomAttributeClass, CustomAttributeContainerProps, EntityClass, Enumeration, Format, InvertedUnit, ISchemaPartVisitor, KindOfQuantity, Mixin, Phenomenon, PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem, StructClass, Unit, UnitSystem } from "@itwin/ecschema-metadata"; import { IDiagnosticReporter } from "./DiagnosticReporter"; import { IRuleSet } from "./Rules"; import { IRuleSuppressionSet } from "./RuleSuppressionSet"; interface RuleSetArray { [name: string]: IRuleSet; } /** * A SchemaWalkerVisitor interface implementation that is used to validate ECObjects schemas using * [[IRuleSet]] objects registered with the instance. Also allows for reporting of [[IDiagnostic]] * objects returned from failing rules using [[IDiagnosticReporter]] implementations registered * with an instance of this class. * @beta */ export declare class SchemaValidationVisitor implements ISchemaPartVisitor { private _reporters; private _ruleSets; private _ruleSuppressionSet?; /** Gets the IRule objects registered with the visitor. */ get ruleSets(): RuleSetArray; get suppressionSet(): IRuleSuppressionSet | undefined; /** Gets the IDiagnosticReporter objects registered with the visitor. */ get diagnosticReporters(): IDiagnosticReporter[]; /** * Registers a [[IDiagnosticReporter]] allowing the reporter to be * notified when a [[IDiagnostic]] is created due to a rule violation. * @param reporter The [[DiagnosticReporter]] to register. */ registerReporter(...reporters: IDiagnosticReporter[]): void; /** * Registers a [[IRuleSet]] that will applied during schema traversal. * @param ruleSet The [[IRuleSet]] to register. */ registerRuleSet(ruleSet: IRuleSet): void; /** * Registers a [[IRuleSuppressionSet]] that will be applied during schema traversal. * @param ruleSet The [[IRuleSuppressionSet]] to register. * Only supports one Rule Suppression Set, if you call it twice it will overwrite the * previous suppression set */ registerRuleSuppressionSet(suppressionSet: IRuleSuppressionSet): void; /** * Called before schema traversal. * @param schema a Schema object. */ visitFullSchema(schema: Schema): Promise; /** * Called for each [[SchemaItem]] instance found during schema traversal. * @param schemaItem a SchemaItem object. */ visitSchemaItem(schemaItem: SchemaItem): Promise; /** * Called for each [AnyClass]($ecschema-metadata) instance found during schema traversal. * @param ecClass an ECClass object. */ visitClass(ecClass: AnyClass): Promise; /** * Called for each [AnyProperty]($ecschema-metadata) instance of an ECClass. * @param property an AnyProperty object. */ visitProperty(property: AnyProperty): Promise; /** * Called for each [EntityClass]($ecschema-metadata) instance found during schema traversal. * @param entityClass an EntityClass object. */ visitEntityClass(entity: EntityClass): Promise; /** * Called for each [StructClass]($ecschema-metadata) instance found during schema traversal. * @param structClass a StructClass object. */ visitStructClass(struct: StructClass): Promise; /** * Called for each [Mixin]($ecschema-metadata) instance found during schema traversal. * @param mixin a Mixin object. */ visitMixin(mixin: Mixin): Promise; /** * Called for each [RelationshipClass]($ecschema-metadata) instance found during schema traversal. * @param relationshipClass a RelationshipClass object. */ visitRelationshipClass(relationship: RelationshipClass): Promise; /** * Called for each [RelationshipConstraint]($ecschema-metadata) of each RelationshipClass found during schema traversal. * @param relationshipConstraint a RelationshipConstraint object. */ visitRelationshipConstraint(constraint: RelationshipConstraint): Promise; /** * Called for each [CustomAttributeClass]($ecschema-metadata) instance found during schema traversal. * @param customAttributeClass a CustomAttributeClass object. */ visitCustomAttributeClass(customAttribute: CustomAttributeClass): Promise; /** * Called for each [CustomAttribute]($ecschema-metadata) container in the schema. * @param customAttributeContainer a [[CustomAttributeContainerProps]] object. */ visitCustomAttributeContainer(container: CustomAttributeContainerProps): Promise; /** * Called for each [Enumeration]($ecschema-metadata) instance found during schema traversal. * @param enumeration an Enumeration object. */ visitEnumeration(enumeration: Enumeration): Promise; /** * Called for each [KindOfQuantity]($ecschema-metadata) instance found during schema traversal. * @param koq a KindOfQuantity object. */ visitKindOfQuantity(koq: KindOfQuantity): Promise; /** * Called for each [PropertyCategory]($ecschema-metadata) instance found during schema traversal. * @param category a PropertyCategory object. */ visitPropertyCategory(category: PropertyCategory): Promise; /** * Called for each [Format]($ecschema-metadata) instance found during schema traversal. * @param format a Format object. */ visitFormat(format: Format): Promise; /** * Called for each [Unit]($ecschema-metadata) instance found during schema traversal. * @param unit a Unit object. */ visitUnit(unit: Unit): Promise; /** * Called for each [InvertedUnit]($ecschema-metadata) instance found during schema traversal. * @param invertedUnit an InvertedUnit object. */ visitInvertedUnit(invertedUnit: InvertedUnit): Promise; /** * Called for each [UnitSystem]($ecschema-metadata) instance found during schema traversal. * @param unitSystem a UnitSystem object. */ visitUnitSystem(unitSystem: UnitSystem): Promise; /** * Called for each [Phenomenon]($ecschema-metadata) instance found during schema traversal. * @param phenomena a Phenomenon object. */ visitPhenomenon(phenomenon: Phenomenon): Promise; /** * Called for each [Constant]($ecschema-metadata) instance found during schema traversal. * @param constant a Constant object. */ visitConstant(constant: Constant): Promise; applySchemaRules(schema: Schema, ruleSet: IRuleSet): Promise; applySchemaItemRules(schemaItem: SchemaItem, ruleSet: IRuleSet): Promise; applyClassRules(ecClass: AnyClass, ruleSet: IRuleSet): Promise; applyPropertyRules(property: AnyProperty, ruleSet: IRuleSet): Promise; applyEntityRules(entityClass: EntityClass, ruleSet: IRuleSet): Promise; applyStructRules(structClass: StructClass, ruleSet: IRuleSet): Promise; applyMixinRules(mixin: Mixin, ruleSet: IRuleSet): Promise; applyRelationshipRules(relationship: RelationshipClass, ruleSet: IRuleSet): Promise; applyRelationshipConstraintRules(constraint: RelationshipConstraint, ruleSet: IRuleSet): Promise; applyCustomAttributeRules(customAttribute: CustomAttributeClass, ruleSet: IRuleSet): Promise; applyCustomAttributeContainerRules(container: CustomAttributeContainerProps, ruleSet: IRuleSet): Promise; applyCustomAttributeInstanceRules(container: CustomAttributeContainerProps, customAttribute: CustomAttribute, ruleSet: IRuleSet): Promise; applyEnumerationRules(enumeration: Enumeration, ruleSet: IRuleSet): Promise; applyKindOfQuantityRules(kindOfQuantity: KindOfQuantity, ruleSet: IRuleSet): Promise; applyPropertyCategoryRules(propertyCategory: PropertyCategory, ruleSet: IRuleSet): Promise; applyFormatRules(format: Format, ruleSet: IRuleSet): Promise; applyUnitRules(unit: Unit, ruleSet: IRuleSet): Promise; applyInvertedUnitRules(invertedUnit: InvertedUnit, ruleSet: IRuleSet): Promise; applyUnitSystemRules(unitSystem: UnitSystem, ruleSet: IRuleSet): Promise; applyPhenomenonRules(phenomenon: Phenomenon, ruleSet: IRuleSet): Promise; applyConstantRules(constant: Constant, ruleSet: IRuleSet): Promise; private findSuppressionRule; private excludeSchemaFromRuleSet; private reportDiagnostics; } export {}; //# sourceMappingURL=SchemaValidationVisitor.d.ts.map