Package org.jboss.jaxb.intros.configmodel

Examples of org.jboss.jaxb.intros.configmodel.ClassIntroConfig


      return LocatableAnnotation.create(((Class<?>)clazz).getAnnotation(annotation), srcPos);
   }

   public boolean hasClassAnnotation(Class clazz, Class<? extends Annotation> annotationType)
   {
      ClassIntroConfig classAnnotations = getClassIntroConfig(clazz);

      if (classAnnotations != null)
      {
         return isClassAnnotationIntroAvailable(annotationType, classAnnotations);
      }
View Full Code Here


   }

   private ClassIntroConfig getClassIntroConfig(Class<?> clazz)
   {
      String className = clazz.getName();
      ClassIntroConfig globalIntro = null;

      for (ClassIntroConfig classIntro : introductions.getClazz())
      {
         if (classIntro.getName().equals(className))
         {
View Full Code Here

      return globalIntro;
   }

   private FieldIntroConfig getFieldIntroConfig(Field field)
   {
      ClassIntroConfig classIntroConfig = getClassIntroConfig(field.getDeclaringClass());

      if (classIntroConfig != null)
      {
         String fieldName = field.getName();

         for (FieldIntroConfig fieldIntro : classIntroConfig.getField())
         {
            if (fieldIntro.getName().equals(fieldName))
            {
               return fieldIntro;
            }
View Full Code Here

      return null;
   }

   private MethodIntroConfig getMethodIntroConfig(Method method)
   {
      ClassIntroConfig classIntroConfig = getClassIntroConfig(method.getDeclaringClass());

      if (classIntroConfig != null)
      {
         String methodName = method.getName();

         for (MethodIntroConfig methodIntro : classIntroConfig.getMethod())
         {
            if (methodIntro.getName().equals(methodName))
            {
               return methodIntro;
            }
View Full Code Here

      return null;
   }

   private <T extends Annotation> T getProxy(Class<T> annotation, Class<?> clazz)
   {
      ClassIntroConfig classIntroConfig = getClassIntroConfig(clazz);

      if (classIntroConfig != null)
      {
         T proxy = getClassAnnotationProxy(annotation, classIntroConfig);
         if (proxy != null)
View Full Code Here

    public void test() throws ConfigurationException {
        JaxbIntros config = IntroductionsConfigParser.parseConfig(getClass().getResourceAsStream("intro-config-01.xml"));

        assertEquals("http://jbossesb.x.jboss.org", config.getDefaultNamespace());
        assertEquals(2, config.getClazz().size());
        ClassIntroConfig classIntroConfig = config.getClazz().get(0);
        assertEquals(TestBean1.class.getName(), classIntroConfig.getName());
        assertEquals("http://jbossesb.y.jboss.org", classIntroConfig.getXmlType().getNamespace());
        assertEquals(1, classIntroConfig.getMethod().size());

        // Could add more tests here but we're OK for now... JAXB seems to be working fine and
        // we'll have more tests on the AnnotationReader!
    }
View Full Code Here

TOP

Related Classes of org.jboss.jaxb.intros.configmodel.ClassIntroConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.