Package org.jboss.metadata.spi.retrieval.basic

Examples of org.jboss.metadata.spi.retrieval.basic.BasicMetaDatasItem


      return annotation.getAnnotation();
   }

   public MetaDatasItem retrieveMetaData()
   {
      BasicMetaDatasItem result = cachedMetaDatasItem;
      if (result != null && result.isValid())
         return result;
     
      Collection<BasicMetaDataItem<?>> all = null;
      Map<String, BasicAnnotationItem<? extends Annotation>> temp1 = annotations;
      if (temp1 != null && temp1.size() > 0)
      {
         all = new ArrayList<BasicMetaDataItem<?>>();
         Collection<BasicAnnotationItem<?>> values = temp1.values();
         all.addAll(values);
      }
      Map<String, BasicMetaDataItem<?>> temp2 = metaDataByName;
      if (temp2 != null && temp2.size() > 0)
      {
         if (all == null)
            all = new ArrayList<BasicMetaDataItem<?>>();
         Collection<BasicMetaDataItem<?>> values = temp2.values();
         all.addAll(values);
      }

      if (all == null)
         return noMetaDatas();
     
      MetaDataItem<?>[] metaDataItems = all.toArray(new MetaDataItem[all.size()]);
      result = new BasicMetaDatasItem(this, metaDataItems);
      cachedMetaDatasItem = result;
      return result;
   }
View Full Code Here


   /**
    * Invalidate the metaDatas item
    */
   protected void invalidateMetaDatasItem()
   {
      BasicMetaDatasItem temp = cachedMetaDatasItem;
      if (temp != null)
      {
         temp.invalidate();
         cachedMetaDatasItem = null;
      }
   }
View Full Code Here

    *
    * @return no meta data
    */
   protected BasicMetaDatasItem noMetaDatas()
   {
      BasicMetaDatasItem result = new BasicMetaDatasItem(this, BasicMetaDatasItem.NO_META_DATA_ITEMS);
      cachedMetaDatasItem = result;
      return result;
   }
View Full Code Here

      BasicMetaDataItem<Object> item1 = new BasicMetaDataItem<Object>(loader, Object.class.getName(), object1);
      BasicMetaDataItem<String> item2 = new BasicMetaDataItem<String>(loader, String.class.getName(), object2);

      MetaDataItem<?>[] items =  { item1, item2 };
     
      BasicMetaDatasItem item = new BasicMetaDatasItem(loader, items);
      MetaDataItem<?>[] result = item.getMetaDatas();
      assertUnorderedArrayEquals(items, result);

      Object[] expected = { object1, object2 };
      Object[] objects = item.getValue();
      assertUnorderedArrayEquals(expected, objects);

      assertTrue(item.isCachable());
      assertTrue(item.isValid());
     
      loader.setCachable(false);
      assertFalse(item.isCachable());
      assertTrue(item.isValid());
     
      item.invalidate();
      assertFalse(item.isCachable());
      assertFalse(item.isValid());
   }
View Full Code Here

      return annotation.getAnnotation();
   }

   public MetaDatasItem retrieveMetaData()
   {
      BasicMetaDatasItem result = cachedMetaDatasItem;
      if (result != null && result.isValid())
         return result;
     
      Collection<BasicMetaDataItem> all = null;
      Map<String, BasicAnnotationItem> temp1 = annotations;
      if (temp1 != null && temp1.size() > 0)
      {
         all = new ArrayList<BasicMetaDataItem>();
         Collection<BasicAnnotationItem> values = temp1.values();
         all.addAll(values);
      }
      Map<String, BasicMetaDataItem> temp2 = metaDataByName;
      if (temp2 != null && temp2.size() > 0)
      {
         if (all == null)
            all = new ArrayList<BasicMetaDataItem>();
         Collection<BasicMetaDataItem> values = temp2.values();
         all.addAll(values);
      }

      if (all == null)
         return noMetaDatas();
     
      MetaDataItem[] metaDataItems = all.toArray(new MetaDataItem[all.size()]);
      result = new BasicMetaDatasItem(this, metaDataItems);
      cachedMetaDatasItem = result;
      return result;
   }
View Full Code Here

   /**
    * Invalidate the metaDatas item
    */
   protected void invalidateMetaDatasItem()
   {
      BasicMetaDatasItem temp = cachedMetaDatasItem;
      if (temp != null)
      {
         temp.invalidate();
         cachedMetaDatasItem = null;
      }
   }
View Full Code Here

    *
    * @return no meta data
    */
   protected BasicMetaDatasItem noMetaDatas()
   {
      BasicMetaDatasItem result = new BasicMetaDatasItem(this, BasicMetaDatasItem.NO_META_DATA_ITEMS);
      cachedMetaDatasItem = result;
      return result;
   }
View Full Code Here

      return annotation.getAnnotation();
   }

   public MetaDatasItem retrieveMetaData()
   {
      BasicMetaDatasItem result = cachedMetaDatasItem;
      if (result != null && result.isValid())
         return result;
     
      Collection<BasicMetaDataItem> all = null;
      Map<String, BasicAnnotationItem> temp1 = annotations;
      if (temp1 != null && temp1.size() > 0)
      {
         all = new ArrayList<BasicMetaDataItem>();
         Collection<BasicAnnotationItem> values = temp1.values();
         all.addAll(values);
      }
      Map<String, BasicMetaDataItem> temp2 = metaDataByName;
      if (temp2 != null && temp2.size() > 0)
      {
         if (all == null)
            all = new ArrayList<BasicMetaDataItem>();
         Collection<BasicMetaDataItem> values = temp2.values();
         all.addAll(values);
      }

      if (all == null)
         return noMetaDatas();
     
      MetaDataItem[] metaDataItems = all.toArray(new MetaDataItem[all.size()]);
      result = new BasicMetaDatasItem(this, metaDataItems);
      cachedMetaDatasItem = result;
      return result;
   }
View Full Code Here

   /**
    * Invalidate the metaDatas item
    */
   protected void invalidateMetaDatasItem()
   {
      BasicMetaDatasItem temp = cachedMetaDatasItem;
      if (temp != null)
      {
         temp.invalidate();
         cachedMetaDatasItem = null;
      }
   }
View Full Code Here

    *
    * @return no meta data
    */
   protected BasicMetaDatasItem noMetaDatas()
   {
      BasicMetaDatasItem result = new BasicMetaDatasItem(this, BasicMetaDatasItem.NO_META_DATA_ITEMS);
      cachedMetaDatasItem = result;
      return result;
   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.spi.retrieval.basic.BasicMetaDatasItem

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.