public class ChainedExtractor<T,E> extends AbstractCompositeExtractor<T,E>
ExternalizableHelper.DecoratedMultiBufferReadBuffer, ExternalizableHelper.DefaultObjectStreamFactory, ExternalizableHelper.FormatAwareCompressor, ExternalizableHelper.IntDecoratedObject, ExternalizableHelper.Shielded, ExternalizableHelper.ShieldedDataOutputStream, ExternalizableHelper.ShieldedInputStream, ExternalizableHelper.ShieldedObjectOutputStream, ExternalizableHelper.ShieldedOutputStream, ExternalizableHelper.SimpleXmlBeanClassCache, ExternalizableHelper.Stats, ExternalizableHelper.XmlBeanClassCache
Base.LoggingWriter, Base.StackFrame
m_aExtractor
KEY, m_nTarget, m_sNameCanon, VALUE
CONVERTER_FROM_BINARY, CONVERTER_STRIP_INTDECO, CONVERTER_TO_BINARY, DECO_APP_1, DECO_APP_2, DECO_APP_3, DECO_CUSTOM, DECO_EXPIRY, DECO_ID_MAX, DECO_ID_MIN, DECO_JCACHE, DECO_JCACHE_SYNTHETIC, DECO_MEMCACHED, DECO_PUSHREP, DECO_QUEUE_METADATA, DECO_RSVD_1, DECO_RSVD_2, DECO_STORE, DECO_TX, DECO_VALUE, DECO_WLS, EMPTY_BINARY_ARRAY, FMT_B_ARRAY, FMT_BIN_DECO, FMT_BIN_EXT_DECO, FMT_BINARY, FMT_BOOLEAN, FMT_BYTE, FMT_DECIMAL, FMT_DOUBLE, FMT_EXT, FMT_FLOAT, FMT_IDO, FMT_INT, FMT_INTEGER, FMT_LONG, FMT_NONE, FMT_NULL, FMT_OBJ_EXT, FMT_OBJ_SER, FMT_OPT, FMT_OPT_DOUBLE, FMT_OPT_INT, FMT_OPT_LONG, FMT_SHORT, FMT_STRING, FMT_UNKNOWN, FMT_XML_BEAN, FMT_XML_SER, FORCE_RESOLVING_STREAMS, MAX_DECO_HEADER_BYTES, PROPERTY_CONFIG, s_streamfactory, TRINT_DOMAIN_SPAN, TRINT_MAX_VALUE, TRINT_MAX_VARIANCE, USE_POF_STREAMS, USE_XMLBEAN_CLASS_CACHE, XMLBEAN_CLASS_CACHE
Constructor and Description |
---|
ChainedExtractor()
Default constructor (necessary for the ExternalizableLite interface).
|
ChainedExtractor(String sName)
Construct a ChainedExtractor for a specified method name sequence.
|
ChainedExtractor(ValueExtractor[] aExtractor)
Construct a ChainedExtractor based on a specified ValueExtractor array.
|
ChainedExtractor(ValueExtractor<? super T,? extends U> extractor1,
ValueExtractor<? super U,? extends E> extractor2)
Construct a ChainedExtractor based on two extractors.
|
Modifier and Type | Method and Description |
---|---|
<V> ValueExtractor<T,V> |
andThen(ValueExtractor<? super E,? extends V> after)
Returns a composed extractor that first applies this extractor to its
input, and then applies the
after extractor to the result. |
<V> ValueExtractor<V,E> |
compose(ValueExtractor<? super V,? extends T> before)
Returns a composed extractor that first applies the
before
extractor to its input, and then applies this extractor to the result. |
protected int |
computeTarget()
Return the target of the first extractor in composite extractor.
|
static ValueExtractor[] |
createExtractors(String sName)
Parse a dot-delimited sequence of method names and instantiate
a corresponding array of
ReflectionExtractor objects. |
void |
ensureTarget()
Ensure that this target is correct after first extractor manually updated.
|
E |
extract(Object oTarget)
Extract the value from the passed object.
|
E |
extractFromEntry(Map.Entry entry)
Extract the value from the passed entry.
|
E |
extractOriginalFromEntry(MapTrigger.Entry entry)
Extract the value from the "original value" of the passed Entry object
or the key (if targeted).
|
String |
getCanonicalName()
Compute a canonical name as a dot-separated concatenation of
the canonical name of each
ValueExtractor array element, starting
from lowest index array element. |
protected static ValueExtractor[] |
merge(ValueExtractor[] aHead,
ValueExtractor[] aTail)
Return a
ValueExtractor array with the provided arrays merged
into a single array. |
void |
readExternal(DataInput in)
Restore the contents of this object by loading the object's state from
the passed DataInput object.
|
void |
readExternal(PofReader in)
Restore the contents of a user type instance by reading its state using
the specified PofReader object.
|
equals, getExtractors, hashCode, toString, writeExternal, writeExternal
compare, compareEntries, getTarget, isCanonicallyEquatable
asBinary, calculatePackedLength, calculatePackedLength, checkObjectInputFilter, convertUTF, decodeExpiry, decorate, decorate, decorate, decorate, decorate, decorateBinary, encodeExpiry, ensureSerializer, extractIntDecoration, fromBinary, fromBinary, fromBinary, fromBinary, fromBinary, fromBinary, fromByteArray, fromByteArray, getClass, getDecoration, getDecoration, getDecorations, getDeltaCompressor, getInputStream, getNewObjectInput, getObjectInput, getObjectOutput, getObjectStreamFactory, getOutputStream, getShieldedOutputStream, getStreamFormat, getUndecorated, getUndecorated, isDecorated, isDecorated, isIntDecorated, isIntDecorated, isResolving, isSerializable, isSerializerCompatible, isVersionCompatible, isVersionCompatible, loadClass, loadResource, main, makeTrint, readBigDecimal, readBigInteger, readBooleanArray, readByteArray, readCollection, readDate, readDoubleArray, readExternalizableLite, readExternalizableLite, readFloatArray, readInt, readInt, readIntArray2d, readLong, readLong, readMap, readMap, readObject, readObject, readSafeUTF, readSafeUTF, readSerializable, readSerializable, readStringArray, readTime, readTimestamp, readTrint, readUnsignedTrint, readUTF, readXmlBean, readXmlSerializable, readXmlSerializable, realize, removeIntDecoration, removeIntDecoration, replace, reportIncompatibleSerializers, setObjectStreamFactory, toBinary, toBinary, toByteArray, toByteArray, toByteArray, toLiteBinary, toLong, undecorate, undecorate, validateBufferSize, writeBigDecimal, writeBigInteger, writeBooleanArray, writeByteArray, writeCollection, writeDate, writeDoubleArray, writeExternalizableLite, writeFloatArray, writeInt, writeInt, writeIntArray2d, writeLong, writeLong, writeMap, writeObject, writeSafeUTF, writeSafeUTF, writeSerializable, writeStringArray, writeTime, writeTimestamp, writeTrint, writeTrint, writeUTF, writeXmlBean, writeXmlSerializable
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString, toBytes, toBytes, toBytes, toBytes, toInt, toInt, toLong
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
apply, applyAsDouble, applyAsInt, applyAsLong, fromKey, identity, identityCast, of
andThen, compose
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public ChainedExtractor()
public ChainedExtractor(ValueExtractor[] aExtractor)
aExtractor
- the ValueExtractor arraypublic ChainedExtractor(ValueExtractor<? super T,? extends U> extractor1, ValueExtractor<? super U,? extends E> extractor2)
U
- the type of value that will be extracted in the first ValueExtractorextractor1
- the first ValueExtractorextractor2
- the second ValueExtractorpublic ChainedExtractor(String sName)
sName
- a dot-delimited sequence of method names which results
in a ChainedExtractor that is based on an array of
corresponding ReflectionExtractor
objectspublic void ensureTarget()
public E extract(Object oTarget)
extract
in interface ValueExtractor<T,E>
extract
in class AbstractExtractor<T,E>
oTarget
- the object to extract the value frompublic E extractFromEntry(Map.Entry entry)
extractFromEntry
in class AbstractExtractor<T,E>
entry
- an Entry object to extract a desired value frompublic E extractOriginalFromEntry(MapTrigger.Entry entry)
AbstractExtractor
AbstractExtractor.extractFromEntry(java.util.Map.Entry)
method.extractOriginalFromEntry
in class AbstractExtractor<T,E>
entry
- an Entry object whose original value should be used to
extract the desired value frompublic <V> ValueExtractor<V,E> compose(ValueExtractor<? super V,? extends T> before)
ValueExtractor
before
extractor to its input, and then applies this extractor to the result.
If evaluation of either extractor throws an exception, it is relayed
to the caller of the composed extractor.V
- the type of input to the before
extractor, and
to the composed extractorbefore
- the extractor to apply before this extractor is appliedbefore
extractor and then applies this extractorValueExtractor.andThen(ValueExtractor)
public <V> ValueExtractor<T,V> andThen(ValueExtractor<? super E,? extends V> after)
ValueExtractor
after
extractor to the result. If
evaluation of either extractor throws an exception, it is relayed to
the caller of the composed extractor.V
- the type of output of the after
extractor, and of
the composed extractorafter
- the extractor to apply after this extractor is appliedafter
extractorValueExtractor.compose(ValueExtractor)
public String getCanonicalName()
ValueExtractor
array element, starting
from lowest index array element.getCanonicalName
in interface com.oracle.coherence.common.base.CanonicallyNamed
getCanonicalName
in interface ValueExtractor<T,E>
getCanonicalName
in class AbstractExtractor<T,E>
ValueExtractor
s.public void readExternal(DataInput in) throws IOException
readExternal
in interface ExternalizableLite
readExternal
in class AbstractCompositeExtractor<T,E>
in
- the DataInput stream to read data from in order to restore
the state of this objectIOException
- if an I/O exception occursNotActiveException
- if the object is not in its initial
state, and therefore cannot be deserialized intopublic void readExternal(PofReader in) throws IOException
readExternal
in interface PortableObject
readExternal
in class AbstractCompositeExtractor<T,E>
in
- the PofReader from which to read the object's stateIOException
- if an I/O error occurspublic static ValueExtractor[] createExtractors(String sName)
ReflectionExtractor
objects.sName
- a dot-delimited sequence of method namesReflectionExtractor
objectsprotected static ValueExtractor[] merge(ValueExtractor[] aHead, ValueExtractor[] aTail)
ValueExtractor
array with the provided arrays merged
into a single array.aHead
- the first group of elements in the returned arrayaTail
- the second group of elements in the returned arrayprotected int computeTarget()
Enables equivalence between KeyExtractor("foo.bar") and ChainExtractor(ReflectionExtractor("foo", null, KEY), ReflectionExtractor("bar")).