public class JSONMatcherBuilder
extends java.lang.Object
Constructor and Description |
---|
JSONMatcherBuilder(com.streambase.sb.Schema inSchema)
create a Matcher that has a companion partial JSON string that mentions each node that will be of interest in the match
|
Modifier and Type | Method and Description |
---|---|
FieldBasedTupleMatcher |
getMatcher() |
JSONMatcherBuilder |
ignoreMissingFields(boolean ignoreMissingFields) |
boolean |
isIgnoreMissingFields() |
FieldBasedTupleMatcher |
makeMatcher(java.lang.String columns)
Build a matcher from string values that matches only the fields given to the constructor.
|
static java.lang.Object |
parseJSONString(java.lang.String JSONString)
create JSON object from string
TODO: The method parseJSONString(String) from the type TupleJSONUtil is not visible, so is recopied here; could remove this if public
|
static com.streambase.sb.AbstractFunction |
readFunctionFromJSON(com.streambase.sb.CompleteDataType cdt,
java.lang.Object jsonObject,
boolean strict) |
static com.streambase.sb.AbstractFunction |
readFunctionFromJSON(com.streambase.sb.CompleteDataType cdt,
java.lang.Object jsonObject,
boolean strict,
java.lang.String timestampFormat) |
void |
setIgnoreMissingFields(boolean ignoreMissingFields) |
com.streambase.sb.Tuple |
setTupleAndMatcher(com.streambase.sb.Tuple tuple,
java.lang.Object jsonObject,
java.lang.String fieldParent)
Set the fields of a tuple based on the contents of a JSON object
>> similar to TupleJSONUtil.setTuple(), but handles depth of matching in subtuples
TODO: is there a way to do similar for lists? This is not evident in FieldBasedTupleMatcher, so a bit tricky i think
|
public JSONMatcherBuilder(com.streambase.sb.Schema inSchema)
inSchema
- public FieldBasedTupleMatcher makeMatcher(java.lang.String columns) throws com.streambase.sb.StreamBaseException
columns
- String value for each column matching the field names in the constructorcom.streambase.sb.StreamBaseException
public static java.lang.Object parseJSONString(java.lang.String JSONString) throws com.streambase.sb.StreamBaseException
JSONString
- com.streambase.sb.StreamBaseException
public com.streambase.sb.Tuple setTupleAndMatcher(com.streambase.sb.Tuple tuple, java.lang.Object jsonObject, java.lang.String fieldParent) throws com.streambase.sb.StreamBaseException
tuple
- the tuple to setjsonObject
- the JSON object; must have at least the fields of the tuple's schemacom.streambase.fastjson.JSONException
com.streambase.sb.StreamBaseException
public static com.streambase.sb.AbstractFunction readFunctionFromJSON(com.streambase.sb.CompleteDataType cdt, java.lang.Object jsonObject, boolean strict) throws com.streambase.sb.StreamBaseException
com.streambase.sb.StreamBaseException
public static com.streambase.sb.AbstractFunction readFunctionFromJSON(com.streambase.sb.CompleteDataType cdt, java.lang.Object jsonObject, boolean strict, java.lang.String timestampFormat) throws com.streambase.sb.StreamBaseException
com.streambase.sb.StreamBaseException
public FieldBasedTupleMatcher getMatcher()
public boolean isIgnoreMissingFields()
public void setIgnoreMissingFields(boolean ignoreMissingFields)
public JSONMatcherBuilder ignoreMissingFields(boolean ignoreMissingFields)