}
public void add(VerifierComponent object) {
if ( VerifierComponentType.FIELD.equals( object.getVerifierComponentType() ) ) {
Field field = (Field) object;
ObjectType objectType = (ObjectType) getVerifierObject( VerifierComponentType.OBJECT_TYPE,
field.getObjectTypePath() );
fieldsByObjectTypeAndFieldName.put( objectType.getFullName() + "." + field.getName(),
field );
fieldsByObjectTypeId.put( field.getObjectTypePath(),
field );
} else if ( VerifierComponentType.RULE.equals( object.getVerifierComponentType() ) ) {
VerifierRule rule = (VerifierRule) object;
rulesByName.put( rule.getName(),
rule );
if ( rule.getMetadata().containsKey( "category" ) ) {
rulesByCategory.put( rule.getMetaAttribute("category"),
rule );
}
} else if ( VerifierComponentType.VARIABLE.equals( object.getVerifierComponentType() ) ) {
Variable variable = (Variable) object;
variablesByRuleAndVariableName.put( variable.getRuleName() + "." + variable.getName(),
variable );
} else if ( VerifierComponentType.PATTERN.equals( object.getVerifierComponentType() ) ) {
Pattern pattern = (Pattern) object;
patternsByObjectTypeId.put( pattern.getObjectTypePath(),
pattern );
patternsByRuleName.put( pattern.getRuleName(),
pattern );
} else if ( VerifierComponentType.RESTRICTION.equals( object.getVerifierComponentType() ) ) {
Restriction restriction = (Restriction) object;
restrictionsByFieldId.put( restriction.getFieldPath(),
restriction );
} else if ( VerifierComponentType.RULE_PACKAGE.equals( object.getVerifierComponentType() ) ) {
RulePackage rulePackage = (RulePackage) object;
packagesByName.put( rulePackage.getName(),
rulePackage );
} else if ( VerifierComponentType.IMPORT.equals( object.getVerifierComponentType() ) ) {
Import objectImport = (Import) object;
importsByName.put( objectImport.getName(),
objectImport );
} else if ( VerifierComponentType.OBJECT_TYPE.equals( object.getVerifierComponentType() ) ) {
ObjectType objectType = (ObjectType) object;
objectTypesByFullName.put( objectType.getFullName(),
objectType );
} else if ( VerifierComponentType.ENTRY_POINT_DESCR.equals( object.getVerifierComponentType() ) ) {
EntryPoint entryPoint = (EntryPoint) object;
entryPointsByEntryId.put( entryPoint.getEntryPointName(),
entryPoint );