1 Reply Latest reply on Sep 27, 2006 9:31 AM by Adrian Brock

    TypeProvider usage

    Ales Justin Master

      How to make lookup for TypeProvider typesafe?

      Some MetaData stats:

      Implementations implementing both TypeProvider and MetaDataVisitorNode:

      AbstractArrayMetaData (org.jboss.beans.metadata.plugins)
      AbstractBeanMetaData (org.jboss.beans.metadata.plugins)
      AbstractCollectionMetaData (org.jboss.beans.metadata.plugins)
      AbstractConstructorMetaData (org.jboss.beans.metadata.plugins)
      AbstractDependencyValueMetaData (org.jboss.beans.metadata.plugins)
      AbstractFeatureMetaData (org.jboss.beans.metadata.plugins)
      AbstractInjectionValueMetaData (org.jboss.beans.metadata.plugins)
      AbstractInstallMetaData (org.jboss.beans.metadata.plugins)
      AbstractLifecycleMetaData (org.jboss.beans.metadata.plugins)
      AbstractListMetaData (org.jboss.beans.metadata.plugins)
      AbstractMapMetaData (org.jboss.beans.metadata.plugins)
      AbstractParameterMetaData (org.jboss.beans.metadata.plugins)
      AbstractPropertyMetaData (org.jboss.beans.metadata.plugins)
      AbstractPropertyMetaData (org.jboss.beans.metadata.plugins)
      AbstractSetMetaData (org.jboss.beans.metadata.plugins)
      AbstractTypeMetaData (org.jboss.beans.metadata.plugins)
      AbstractValueMetaData (org.jboss.beans.metadata.plugins)
      AspectBeanMetaDataFactory (org.jboss.aop.microcontainer.beans)
      GenericBeanFactoryMetaData (org.jboss.beans.metadata.plugins.factory)
      StringValueMetaData (org.jboss.beans.metadata.plugins)
      ThisValueMetaData (org.jboss.beans.metadata.plugins)

      Only MetaDataVisitorNode:

      AbstractAnnotationMetaData (org.jboss.beans.metadata.plugins)
      AbstractClassLoaderMetaData (org.jboss.beans.metadata.plugins)
      AbstractDemandMetaData (org.jboss.beans.metadata.plugins)
      AbstractSupplyMetaData (org.jboss.beans.metadata.plugins)


      We could make MetaDataVisitorNode implement TypeProvider?
      Or I could move down the stack until I find a node which implements TP?
      Or just a simple check - trusting xsd to handle invalid MD definition / construction?

      Will also look into fixing that popping and pushing.

        • 1. Re: TypeProvider usage
          Adrian Brock Master

           

          "alesj" wrote:
          How to make lookup for TypeProvider typesafe?


          No idea, but it should at least be something like:
          if (object instanceof TypeProvider)
           TypeProvider type = (TypeProvider) object
           ...
          else
           either fail with a better error message, log a WARNing, or ignore with a TRACE message
          


          NullPointerException, ClassCastException, etc. are not acceptable
          error messages to present to a user. :-)