test_class.declarator: topicmap
test_class.modifier: protected
test_class.original_string: protected TopicMapIF topicmap;
test_class.type: TopicMapIF
test_class.var_name: topicmap
test_class.declarator: builder
test_class.modifier: protected
test_class.original_string: protected TopicMapBuilderIF builder;
test_class.type: TopicMapBuilderIF
test_class.var_name: builder
test_class.file: ontopia-schema/src/test/java/net/ontopia/topicmaps/schema/impl/osl/SchemaValidatorTest.java
test_class.identifier: SchemaValidatorTest
test_class.superclass: extends AbstractSchemaTestCase
test_case.body: @Test
    public void testLevelOfScopeMatchingExact() throws IOException, SchemaSyntaxException {
      OSLSchema schema = (OSLSchema) readSchema("in", "scopelevel-exact.xml");
  
      TopicIF type = makeType("#something");
      TopicIF instance = builder.makeTopic();
      instance.addType(type);
  
      TopicIF occscope = makeType("#occ_scope");
  
      TopicIF occtype = makeType("#occtype");
      OccurrenceIF occ = builder.makeOccurrence(instance, occtype, "");
  
      occ.addTheme(occscope);
  
      validate(schema);
    }
test_case.class_method_signature: SchemaValidatorTest.testLevelOfScopeMatchingExact()
test_case.full_signature: @Test public void testLevelOfScopeMatchingExact()
test_case.identifier: testLevelOfScopeMatchingExact
test_case.invocations: readSchema makeType makeTopic addType makeType makeType makeOccurrence addTheme validate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLevelOfScopeMatchingExact()
focal_class.declarator: schema
focal_class.modifier: protected
focal_class.original_string: protected OSLSchema schema;
focal_class.type: OSLSchema
focal_class.var_name: schema
focal_class.declarator: handler
focal_class.modifier: protected
focal_class.original_string: protected ValidationHandlerIF handler;
focal_class.type: ValidationHandlerIF
focal_class.var_name: handler
focal_class.file: ontopia-schema/src/main/java/net/ontopia/topicmaps/schema/impl/osl/SchemaValidator.java
focal_class.identifier: SchemaValidator
focal_class.interfaces: implements SchemaValidatorIF
focal_class.class_method_signature: SchemaValidator.SchemaValidator(OSLSchema schema)
focal_class.full_signature:   SchemaValidator(OSLSchema schema)
focal_class.identifier: SchemaValidator
focal_class.parameters: (OSLSchema schema)
focal_class.signature:  SchemaValidator(OSLSchema schema)
focal_class.class_method_signature: SchemaValidator.validate(TopicIF topic)
focal_class.full_signature: @Override public void validate(TopicIF topic)
focal_class.identifier: validate
focal_class.modifiers: @Override public
focal_class.parameters: (TopicIF topic)
focal_class.return: void
focal_class.signature: void validate(TopicIF topic)
focal_class.class_method_signature: SchemaValidator.validate(TopicMapIF topicmap)
focal_class.full_signature: @Override public void validate(TopicMapIF topicmap)
focal_class.identifier: validate
focal_class.modifiers: @Override public
focal_class.parameters: (TopicMapIF topicmap)
focal_class.return: void
focal_class.signature: void validate(TopicMapIF topicmap)
focal_class.class_method_signature: SchemaValidator.validate(AssociationIF association)
focal_class.full_signature: @Override public void validate(AssociationIF association)
focal_class.identifier: validate
focal_class.modifiers: @Override public
focal_class.parameters: (AssociationIF association)
focal_class.return: void
focal_class.signature: void validate(AssociationIF association)
focal_class.class_method_signature: SchemaValidator.setValidationHandler(ValidationHandlerIF handler)
focal_class.full_signature: @Override public void setValidationHandler(ValidationHandlerIF handler)
focal_class.identifier: setValidationHandler
focal_class.modifiers: @Override public
focal_class.parameters: (ValidationHandlerIF handler)
focal_class.return: void
focal_class.signature: void setValidationHandler(ValidationHandlerIF handler)
focal_class.class_method_signature: SchemaValidator.getValidationHandler()
focal_class.full_signature: @Override public ValidationHandlerIF getValidationHandler()
focal_class.identifier: getValidationHandler
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ValidationHandlerIF
focal_class.signature: ValidationHandlerIF getValidationHandler()
focal_class.class_method_signature: SchemaValidator.validate(TMObjectIF container, Collection constraints,
                            Collection objects)
focal_class.full_signature: protected void validate(TMObjectIF container, Collection constraints,
                            Collection objects)
focal_class.identifier: validate
focal_class.modifiers: protected
focal_class.parameters: (TMObjectIF container, Collection constraints,
                            Collection objects)
focal_class.return: void
focal_class.signature: void validate(TMObjectIF container, Collection constraints,
                            Collection objects)
focal_class.class_method_signature: SchemaValidator.validate(TMObjectIF container, Collection constraints,
                            Collection objects, boolean strict)
focal_class.full_signature: protected void validate(TMObjectIF container, Collection constraints,
                            Collection objects, boolean strict)
focal_class.identifier: validate
focal_class.modifiers: protected
focal_class.parameters: (TMObjectIF container, Collection constraints,
                            Collection objects, boolean strict)
focal_class.return: void
focal_class.signature: void validate(TMObjectIF container, Collection constraints,
                            Collection objects, boolean strict)
focal_class.class_method_signature: SchemaValidator.validate(TMObjectIF object, ConstraintIF constraint)
focal_class.full_signature: protected void validate(TMObjectIF object, ConstraintIF constraint)
focal_class.identifier: validate
focal_class.modifiers: protected
focal_class.parameters: (TMObjectIF object, ConstraintIF constraint)
focal_class.return: void
focal_class.signature: void validate(TMObjectIF object, ConstraintIF constraint)
focal_class.class_method_signature: SchemaValidator.validate(TopicNameIF basename, TopicNameConstraint constraint)
focal_class.full_signature: protected void validate(TopicNameIF basename, TopicNameConstraint constraint)
focal_class.identifier: validate
focal_class.modifiers: protected
focal_class.parameters: (TopicNameIF basename, TopicNameConstraint constraint)
focal_class.return: void
focal_class.signature: void validate(TopicNameIF basename, TopicNameConstraint constraint)
focal_class.class_method_signature: SchemaValidator.validate(VariantNameIF variant, VariantConstraint constraint)
focal_class.full_signature: protected void validate(VariantNameIF variant, VariantConstraint constraint)
focal_class.identifier: validate
focal_class.modifiers: protected
focal_class.parameters: (VariantNameIF variant, VariantConstraint constraint)
focal_class.return: void
focal_class.signature: void validate(VariantNameIF variant, VariantConstraint constraint)
focal_class.class_method_signature: SchemaValidator.validate(OccurrenceIF occ, OccurrenceConstraint constraint)
focal_class.full_signature: protected void validate(OccurrenceIF occ, OccurrenceConstraint constraint)
focal_class.identifier: validate
focal_class.modifiers: protected
focal_class.parameters: (OccurrenceIF occ, OccurrenceConstraint constraint)
focal_class.return: void
focal_class.signature: void validate(OccurrenceIF occ, OccurrenceConstraint constraint)
focal_class.class_method_signature: SchemaValidator.validate(AssociationRoleIF role, TopicRoleConstraint constraint)
focal_class.full_signature: protected void validate(AssociationRoleIF role, TopicRoleConstraint constraint)
focal_class.identifier: validate
focal_class.modifiers: protected
focal_class.parameters: (AssociationRoleIF role, TopicRoleConstraint constraint)
focal_class.return: void
focal_class.signature: void validate(AssociationRoleIF role, TopicRoleConstraint constraint)
focal_class.class_method_signature: SchemaValidator.validate(AssociationRoleIF role, AssociationRoleConstraint constraint)
focal_class.full_signature: protected void validate(AssociationRoleIF role, AssociationRoleConstraint constraint)
focal_class.identifier: validate
focal_class.modifiers: protected
focal_class.parameters: (AssociationRoleIF role, AssociationRoleConstraint constraint)
focal_class.return: void
focal_class.signature: void validate(AssociationRoleIF role, AssociationRoleConstraint constraint)
focal_class.class_method_signature: SchemaValidator.validateScope(TMObjectIF container, ScopedIF scoped,
                                 ScopedConstraintIF constraint)
focal_class.full_signature: protected void validateScope(TMObjectIF container, ScopedIF scoped,
                                 ScopedConstraintIF constraint)
focal_class.identifier: validateScope
focal_class.modifiers: protected
focal_class.parameters: (TMObjectIF container, ScopedIF scoped,
                                 ScopedConstraintIF constraint)
focal_class.return: void
focal_class.signature: void validateScope(TMObjectIF container, ScopedIF scoped,
                                 ScopedConstraintIF constraint)
focal_class.class_method_signature: SchemaValidator.findClass(TMObjectIF object, Collection classes)
focal_class.full_signature: protected ConstraintIF findClass(TMObjectIF object, Collection classes)
focal_class.identifier: findClass
focal_class.modifiers: protected
focal_class.parameters: (TMObjectIF object, Collection classes)
focal_class.return: ConstraintIF
focal_class.signature: ConstraintIF findClass(TMObjectIF object, Collection classes)
focal_class.class_method_signature: SchemaValidator.findClass(TopicIF topic, Collection classes)
focal_class.full_signature: protected ConstraintIF findClass(TopicIF topic, Collection classes)
focal_class.identifier: findClass
focal_class.modifiers: protected
focal_class.parameters: (TopicIF topic, Collection classes)
focal_class.return: ConstraintIF
focal_class.signature: ConstraintIF findClass(TopicIF topic, Collection classes)
focal_class.class_method_signature: SchemaValidator.findClassFor(TopicIF tclass, Collection classes)
focal_class.full_signature: protected ConstraintIF findClassFor(TopicIF tclass, Collection classes)
focal_class.identifier: findClassFor
focal_class.modifiers: protected
focal_class.parameters: (TopicIF tclass, Collection classes)
focal_class.return: ConstraintIF
focal_class.signature: ConstraintIF findClassFor(TopicIF tclass, Collection classes)
focal_class.class_method_signature: SchemaValidator.getTopic(TopicClass klass, TopicMapIF tm)
focal_class.full_signature: protected TopicIF getTopic(TopicClass klass, TopicMapIF tm)
focal_class.identifier: getTopic
focal_class.modifiers: protected
focal_class.parameters: (TopicClass klass, TopicMapIF tm)
focal_class.return: TopicIF
focal_class.signature: TopicIF getTopic(TopicClass klass, TopicMapIF tm)
focal_class.class_method_signature: SchemaValidator.getRange(CardinalityConstraintIF constraint)
focal_class.full_signature: private String getRange(CardinalityConstraintIF constraint)
focal_class.identifier: getRange
focal_class.modifiers: private
focal_class.parameters: (CardinalityConstraintIF constraint)
focal_class.return: String
focal_class.signature: String getRange(CardinalityConstraintIF constraint)
focal_method.body: @Override
    public void validate(TopicIF topic) throws SchemaViolationException {
      // find appropriate class
      TopicClass klass = (TopicClass) findClass(topic, schema.getTopicClasses());
      if (klass == null) {
        if (schema.isStrict())
          handler.violation("No matching rule for topic",
                            topic.getTopicMap(), topic, null);
        return;
      }
  
      // pick out constraint collections
      Collection basenamecs = klass.getAllTopicNameConstraints();
      Collection occurrencecs = klass.getAllOccurrenceConstraints();
      Collection rolecs = klass.getAllRoleConstraints();
      
      // other classes
      Collection others = klass.getOtherClasses();
      Iterator it = topic.getTypes().iterator();
      while (it.hasNext()) {
        TopicIF tclass = (TopicIF) it.next();
        if (klass.getTypeSpecification().matchType(tclass))
          continue;
  
        boolean found = false;
        Iterator it2 = others.iterator();
        while (it2.hasNext()) {
          TypeSpecification typespec = (TypeSpecification) it2.next();
  
          if (typespec.matchType(tclass)) {
            found = true;
            TopicClass otherclass =
              (TopicClass) findClassFor(tclass, schema.getTopicClasses());
  
            if (otherclass != null) {
              basenamecs.addAll(otherclass.getAllTopicNameConstraints());
              occurrencecs.addAll(otherclass.getAllOccurrenceConstraints());
              rolecs.addAll(otherclass.getAllRoleConstraints());
            }
            break;
          }
        }
  
        if (!found)
          handler.violation("Topic instance of illegal other class",
                            topic, tclass, null);
      }
  
      // characteristics
      validate(topic, basenamecs, topic.getTopicNames(), klass.isStrict());
      validate(topic, occurrencecs, topic.getOccurrences(), klass.isStrict());
      validate(topic, rolecs, topic.getRoles(), klass.isStrict());
    }
focal_method.class_method_signature: SchemaValidator.validate(TopicIF topic)
focal_method.full_signature: @Override public void validate(TopicIF topic)
focal_method.identifier: validate
focal_method.invocations: findClass getTopicClasses isStrict violation getTopicMap getAllTopicNameConstraints getAllOccurrenceConstraints getAllRoleConstraints getOtherClasses iterator getTypes hasNext next matchType getTypeSpecification iterator hasNext next matchType findClassFor getTopicClasses addAll getAllTopicNameConstraints addAll getAllOccurrenceConstraints addAll getAllRoleConstraints violation validate getTopicNames isStrict validate getOccurrences isStrict validate getRoles isStrict
focal_method.modifiers: @Override public
focal_method.parameters: (TopicIF topic)
focal_method.return: void
focal_method.signature: void validate(TopicIF topic)