Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

coherence/util/extractor/ChainedExtractor.hpp

00001 /*
00002 * ChainedExtractor.hpp
00003 *
00004 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
00005 *
00006 * Oracle is a registered trademarks of Oracle Corporation and/or its
00007 * affiliates.
00008 *
00009 * This software is the confidential and proprietary information of Oracle
00010 * Corporation. You shall not disclose such confidential and proprietary
00011 * information and shall use it only in accordance with the terms of the
00012 * license agreement you entered into with Oracle.
00013 *
00014 * This notice may not be removed or altered.
00015 */
00016 #ifndef COH_CHAINED_EXTRACTOR_HPP
00017 #define COH_CHAINED_EXTRACTOR_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/util/ValueExtractor.hpp"
00022 #include "coherence/util/Map.hpp"
00023 #include "coherence/util/extractor/AbstractCompositeExtractor.hpp"
00024 
00025 COH_OPEN_NAMESPACE3(coherence,util,extractor)
00026 
00027 
00028 /**
00029 * Composite ValueExtractor implementation based on an array of extractors.
00030 * The extractors in the array are applied sequentially left-to-right, so a
00031 * result of a previous extractor serves as a target object for a next one.
00032 *
00033 * @author djl 2008.03.07
00034 *
00035 * @see ChainedExtractor
00036 */
00037 class COH_EXPORT ChainedExtractor
00038     : public class_spec<ChainedExtractor,
00039         extends<AbstractCompositeExtractor> >
00040     {
00041     friend class factory<ChainedExtractor>;
00042 
00043     // ----- constructors ---------------------------------------------------
00044 
00045     protected:
00046         /**
00047         * Default constructor (necessary for the PortableObject interface).
00048         */
00049         ChainedExtractor();
00050 
00051         /**
00052         * Return a ChainedExtractor based on a specified array.
00053         *
00054         * @param vaExtractor  the ValueExtractor array
00055         */
00056         ChainedExtractor(ObjectArray::View vaExtractor);
00057 
00058         /**
00059         * Construct a ChainedExtractor based on two extractors.
00060         *
00061         * @param vExtractor1  the ValueExtractor
00062         * @param vExtractor2  the ValueExtractor
00063         */
00064         ChainedExtractor(ValueExtractor::View vExtractor1,
00065                 ValueExtractor::View vExtractor2);
00066 
00067     private:
00068         /**
00069         * Blocked copy constructor.
00070         */
00071         ChainedExtractor(const ChainedExtractor&);
00072 
00073 
00074     // ----- AbstractExtractor methods --------------------------------------
00075 
00076     public:
00077         /**
00078         * {@inheritDoc}
00079         */
00080         virtual Object::Holder extract(Object::Holder ohTarget) const;
00081 
00082         /**
00083         * Extract the value from the passed entry. The underlying extractors
00084         * are applied sequentially, so a result of a previous extractor serves
00085         * as a target object for a next one. A value of null prevents any
00086         * further extractions and is returned immediately. For intrinsic types,
00087         * the returned value is expected to be a standard wrapper type in the
00088         * same manner that reflection works; for example, int would be
00089         * returned as a Integer32.
00090         */
00091         virtual Object::Holder extractFromEntry(Map::Entry::Holder ohEntry) const;
00092 
00093 
00094     // ----- helpers --------------------------------------------------------
00095 
00096     public:
00097         /**
00098         * Parse a dot-delimited sequence of method names and instantiate
00099         * a corresponding array of {@link ReflectionExtractor} objects.
00100         *
00101         * @param vsName  a dot-delimited sequence of method names
00102         *
00103         * @return an array of {@link ReflectionExtractor} objects
00104         */
00105         static ObjectArray::View createExtractors(String::View vsName);
00106     };
00107 
00108 COH_CLOSE_NAMESPACE3
00109 
00110 #endif // COH_CHAINED_EXTRACTOR_HPP
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.