Package com.tangosol.util.extractor

Examples of com.tangosol.util.extractor.ReflectionExtractor


        Assert.assertEquals(null, p3.getValue(String.class));
        Assert.assertEquals(10, p4.getValue(Integer.class));
        Assert.assertEquals(Arrays.toString(new boolean[]{true, true, false, false}), Arrays.toString((boolean[])p5.getValue(boolean[].class)));
       
        Object[] array = (Object[]) p6.getValue(ReflectionExtractor[].class);
        ReflectionExtractor e = (ReflectionExtractor) ((PofArray)p6).getChild(0).getValue();
       
        Assert.assertEquals("A", ((ReflectionExtractor)array[0]).getMethodName());
        Assert.assertEquals("A", e.getMethodName());
       
    }
View Full Code Here


            out.writeString(1, "ABC");
            out.writeString(2, "");
            out.writeString(3, null);
            out.writeInt(4, 10);
            out.writeBooleanArray(5, new boolean[]{true, true, false, false});
            out.writeObjectArray(6, new ReflectionExtractor[]{new ReflectionExtractor("A")});
        }
View Full Code Here

         } else {
            if (orderBy == null) {
               comparator = null;
            } else if (orderBy.size() == 1) {
               Map.Entry<String, SortOrder> entry = orderBy.entrySet().iterator().next();
               Comparator comp = new ReflectionExtractor(entry.getKey());
               comparator = entry.getValue() == SortOrder.ASCENDING ? comp : new InverseComparator(comp);
            } else {
               ArrayList<Comparator> comparators = new ArrayList<Comparator>(orderBy.size());
               for (Map.Entry<String, SortOrder> entry : orderBy.entrySet()) {
                  Comparator comp = new ReflectionExtractor(entry.getKey());
                  comparators.add(entry.getValue() == SortOrder.ASCENDING ? comp : new InverseComparator(comp));
               }
               comparator = new ChainedComparator(comparators.toArray(new Comparator[comparators.size()]));
            }
            if (offset > 0 && limit >= 0) {
View Full Code Here

            if (projection.length == 1) {
               aggregator = new ReducerAggregator(projection[0]);
            } else {
               ValueExtractor[] extractors = new ValueExtractor[projection.length];
               for (int i = 0; i < projection.length; ++i) {
                  extractors[i] = projection[i].indexOf('.') < 0 ? new ReflectionExtractor(projection[i]) : new ChainedExtractor(projection[i]);
               }
               aggregator = new ReducerAggregator(new MultiExtractor(extractors));
            }
            Map map;
            if (comparator != null || skip > 0 || limit >= 0) {
View Full Code Here

   }

   public void registerIndices(NamedCache cache, List<Coherence3Service.IndexedColumn> indexedColumns) {
      for (Coherence3Service.IndexedColumn c : service.indexedColumns) {
         if (cache.getCacheName().equals(c.cache)) {
            ReflectionExtractor extractor = new ReflectionExtractor(c.attribute);
            cache.addIndex(extractor, c.ordered, null);
         }
      }
   }
View Full Code Here

TOP

Related Classes of com.tangosol.util.extractor.ReflectionExtractor

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.