public Path newPath() { return new CandidatePath(); }
public Value cast(Value val, Class cls) { if (val instanceof CandidatePath) ((CandidatePath) val).castTo(cls); else if (val instanceof BoundVariable) ((BoundVariable) val).castTo(cls); else val = new Cast((Val) val, cls); return val; }
protected Object eval(Object candidate, Object orig, StoreContext ctx, Object[] params) { // evaluate with the value's value return super.eval(_val.eval(candidate, orig, ctx, params), orig, ctx, params); }
protected Class getCandidateType() { ClassMetaData meta = getMetaData(); if (meta == null) return Object.class; return meta.getDescribedType(); }
public Class getType() { if (_actions == null) return getCandidateType(); Object last = _actions.getLast(); if (last instanceof Class) return (Class) last; FieldMetaData fmd = ((Traversal) last).field; return fmd.getDeclaredType(); }
@Override public void enter(Value val) { log.debug("in enter with value {}", val); // it's a variable add it to the field if (val instanceof CandidatePath) { field = ((CandidatePath) val).last(); log.debug("field name {} and {}", field.getName(), field); return; } if (val instanceof Literal) { value = ((Literal) val).getValue(); return; } if (val instanceof Parameter) { log.debug("reset with value {}", val); value = ((Parameter) val).getValue(params); return; } if(val instanceof Null){ value = null; return; } }
public Value cast(Value val, Class cls) { if (val instanceof CandidatePath) ((CandidatePath) val).castTo(cls); else if (val instanceof BoundVariable) ((BoundVariable) val).castTo(cls); else val = new Cast((Val) val, cls); return val; }
protected Object eval(Object candidate, Object orig, StoreContext ctx, Object[] params) { // evaluate with the value's value return super.eval(_val.eval(candidate, orig, ctx, params), orig, ctx, params); }
protected Class getCandidateType() { ClassMetaData meta = getMetaData(); if (meta == null) return Object.class; return meta.getDescribedType(); }
public Class getType() { if (_actions == null) return getCandidateType(); Object last = _actions.getLast(); if (last instanceof Class) return (Class) last; FieldMetaData fmd = ((Traversal) last).field; return fmd.getDeclaredType(); }
public Value cast(Value val, Class cls) { if (val instanceof CandidatePath) ((CandidatePath) val).castTo(cls); else if (val instanceof BoundVariable) ((BoundVariable) val).castTo(cls); else val = new Cast((Val) val, cls); return val; }
protected Object eval(Object candidate, Object orig, StoreContext ctx, Object[] params) { // evaluate with the value's value return super.eval(_val.eval(candidate, orig, ctx, params), orig, ctx, params); }
protected Class getCandidateType() { ClassMetaData meta = getMetaData(); if (meta == null) return Object.class; return meta.getDescribedType(); }
public Path newPath() { return new CandidatePath(); }
public Class getType() { if (_actions == null) return getCandidateType(); Object last = _actions.getLast(); if (last instanceof Class) return (Class) last; FieldMetaData fmd = ((Traversal) last).field; return fmd.getDeclaredType(); }
public Value cast(Value val, Class cls) { if (val instanceof CandidatePath) ((CandidatePath) val).castTo(cls); else if (val instanceof BoundVariable) ((BoundVariable) val).castTo(cls); else val = new Cast((Val) val, cls); return val; }
protected Object eval(Object candidate, Object orig, StoreContext ctx, Object[] params) { // evaluate with the value's value return super.eval(_val.eval(candidate, orig, ctx, params), orig, ctx, params); }
protected Class getCandidateType() { ClassMetaData meta = getMetaData(); if (meta == null) return Object.class; return meta.getDescribedType(); }
public Path newPath() { return new CandidatePath(); }
public Class getType() { if (_actions == null) return getCandidateType(); Object last = _actions.getLast(); if (last instanceof Class) return (Class) last; FieldMetaData fmd = ((Traversal) last).field; return fmd.getDeclaredType(); }