def add_metadata(klass)
      logger.debug("Adding #{self}::#{klass.qp} metadata...")
      # Mark the class as introspected. Do this first to preclude a recursive loop back
      # into this method when the references are introspected below.
      @introspected << klass
      # Add the superclass meta-data if necessary.
      add_superclass_metadata(klass)
      # Include this resource module into the class, unless this has already occurred.
      unless klass < self then
        m = self
        klass.class_eval { include m }
      end
      # Import the class into this resource module, unless this has already occurred.
      name = klass.name.demodulize
      unless const_defined?(name) then
        java_import(klass.java_class.name)
      end
      # Add introspection capability to the class.
      md_mod = @metadata_module || Metadata
      logger.debug { "Extending #{self}::#{klass.qp} with #{md_mod.name}..." }
      klass.extend(md_mod)
      # Set the class domain module.
      klass.domain_module = self
      # Introspect the Java properties.
      klass.introspect
      # Add the {attribute => value} initializer.
      klass.add_attribute_value_initializer if Class === klass
      # Add referenced domain class metadata as necessary.
      klass.each_property do |prop|
        ref = prop.type
        if ref.nil? then raise MetadataError.new("#{self} #{prop} domain type is unknown.") end
        if introspectible?(ref) then
          logger.debug { "Introspecting the #{klass.qp} #{prop} reference type #{ref.qp}..." }
          add_metadata(ref)
        end
      end
      # If the class has a definition file but does not resolve to a standard package, then
      # load it now based on the demodulized class name match.
      file = @unresolved_defs[name]
      load_definition(klass, file) if file
      
      logger.debug("#{self}::#{klass.qp} metadata added.")
    end
def add_metadata(klass)
      logger.debug("Adding #{self}::#{klass.qp} metadata...")
      # Mark the class as introspected. Do this first to preclude a recursive loop back
      # into this method when the references are introspected below.
      @introspected << klass
      # Add the superclass meta-data if necessary.
      add_superclass_metadata(klass)
      # Include this resource module into the class, unless this has already occurred.
      unless klass < self then
        m = self
        klass.class_eval { include m }
      end
      # Import the class into this resource module, unless this has already occurred.
      name = klass.name.demodulize
      unless const_defined?(name) then
        java_import(klass.java_class.name)
      end
      # Add introspection capability to the class.
      md_mod = @metadata_module || Metadata
      logger.debug { "Extending #{self}::#{klass.qp} with #{md_mod.name}..." }
      klass.extend(md_mod)
      # Set the class domain module.
      klass.domain_module = self
      # Introspect the Java properties.
      klass.introspect
      # Add the {attribute => value} initializer.
      klass.add_attribute_value_initializer if Class === klass
      # Add referenced domain class metadata as necessary.
      klass.each_property do |prop|
        ref = prop.type
        if ref.nil? then raise MetadataError.new("#{self} #{prop} domain type is unknown.") end
        if introspectible?(ref) then
          logger.debug { "Introspecting the #{klass.qp} #{prop} reference type #{ref.qp}..." }
          add_metadata(ref)
        end
      end
      # If the class has a definition file but does not resolve to a standard package, then
      # load it now based on the demodulized class name match.
      file = @unresolved_defs[name]
      load_definition(klass, file) if file
      
      logger.debug("#{self}::#{klass.qp} metadata added.")
    end
Introspects the given class meta-data.

 @param [Class] klass the Java class or interface to introspect