public BaseVisitor(RequestScope requestScope) { state = new StateContext(new StartState(), requestScope); }
@Override public void handle(StateContext state, RootCollectionLoadEntityContext ctx) { PersistentResource record = entityRecord(state, ctx.entity()); state.setState(new RecordTerminalState(record)); }
@Override public void handle(StateContext state, RootCollectionSubCollectionContext ctx) { PersistentResource record = entityRecord(state, ctx.entity()); state.setState(new RecordState(record)); }
@Override public void handle(StateContext state, RootCollectionLoadEntityContext ctx) { PersistentResource record = entityRecord(state, ctx.entity()); state.setState(new RecordTerminalState(record)); }
public BaseVisitor(RequestScope requestScope) { state = new StateContext(new StartState(), requestScope); }
@Override public void handle(StateContext state, RootCollectionSubCollectionContext ctx) { PersistentResource record = entityRecord(state, ctx.entity()); state.setState(new RecordState(record)); }
@Override public void handle(StateContext state, RootCollectionRelationshipContext ctx) { PersistentResource record = entityRecord(state, ctx.entity()); String relationName = ctx.relationship().term().getText(); try { Optional<FilterExpression> filterExpression = state.getRequestScope().getExpressionForRelation(record, relationName); record.getRelationCheckedFiltered(relationName, filterExpression, Optional.empty(), Optional.empty()); } catch (InvalidAttributeException e) { throw new InvalidCollectionException(relationName); } state.setState(new RelationshipTerminalState(record, relationName)); }
@Override public void handle(StateContext state, RootCollectionRelationshipContext ctx) { PersistentResource record = entityRecord(state, ctx.entity()); String relationName = ctx.relationship().term().getText(); try { Optional<FilterExpression> filterExpression = state.getRequestScope().getExpressionForRelation(record, relationName); record.getRelationCheckedFiltered(relationName, filterExpression, Optional.empty(), Optional.empty()); } catch (InvalidAttributeException e) { throw new InvalidCollectionException(relationName); } state.setState(new RelationshipTerminalState(record, relationName)); }