diff --git a/src/main/java/li/strolch/model/query/OrderQuery.java b/src/main/java/li/strolch/model/query/OrderQuery.java index dac4c0d9f..0a5c1b63e 100644 --- a/src/main/java/li/strolch/model/query/OrderQuery.java +++ b/src/main/java/li/strolch/model/query/OrderQuery.java @@ -18,7 +18,6 @@ package li.strolch.model.query; import li.strolch.model.Order; import li.strolch.model.OrderVisitor; import li.strolch.model.parameter.Parameter; -import li.strolch.model.visitor.NoStrategyOrderVisitor; /** * {@link OrderQuery} is the user API to query {@link Order Orders} in Strolch. The {@link Navigation} is used to @@ -29,56 +28,17 @@ import li.strolch.model.visitor.NoStrategyOrderVisitor; * * @author Robert von Burg */ -public class OrderQuery extends StrolchQuery { +public class OrderQuery extends StrolchQuery { - private OrderVisitor elementVisitor; - - public OrderQuery(Navigation navigation, OrderVisitor elementVisitor) { + public OrderQuery(Navigation navigation) { super(navigation); - this.elementVisitor = elementVisitor; } - /** - * @return the elementVisitor - */ - public OrderVisitor getElementVisitor() { - return this.elementVisitor; + public static OrderQuery query(Navigation navigation) { + return new OrderQuery(navigation); } - /** - * Returns an instance of {@link OrderQuery} where the visitor used is the {@link NoStrategyOrderVisitor} thus - * returning the actual Order, i.e. no transformation is performed - * - * @param navigation - * @return - */ - public static OrderQuery query(Navigation navigation) { - return new OrderQuery(navigation, new NoStrategyOrderVisitor()); - } - - /** - * Returns an instance of {@link OrderQuery} where the visitor used is the {@link NoStrategyOrderVisitor} thus - * returning the actual Order, i.e. no transformation is performed - * - * @param type - * the type of Order to navigate to - * @return - */ - public static OrderQuery query(String type) { - return new OrderQuery(new StrolchTypeNavigation(type), new NoStrategyOrderVisitor()); - } - - /** - * Returns an instance of {@link OrderQuery} using the given {@link OrderVisitor} thus performing the given - * transformation - * - * @param type - * the type of Order to navigate to - * @param orderVisitor - * the visitor to use for transformation - * @return - */ - public static OrderQuery query(String type, OrderVisitor orderVisitor) { - return new OrderQuery(new StrolchTypeNavigation(type), orderVisitor); + public static OrderQuery query(String type) { + return new OrderQuery(new StrolchTypeNavigation(type)); } } diff --git a/src/main/java/li/strolch/model/query/ResourceQuery.java b/src/main/java/li/strolch/model/query/ResourceQuery.java index 6133b7c5b..7741c041b 100644 --- a/src/main/java/li/strolch/model/query/ResourceQuery.java +++ b/src/main/java/li/strolch/model/query/ResourceQuery.java @@ -18,7 +18,6 @@ package li.strolch.model.query; import li.strolch.model.Resource; import li.strolch.model.ResourceVisitor; import li.strolch.model.parameter.Parameter; -import li.strolch.model.visitor.NoStrategyResourceVisitor; /** * {@link ResourceQuery} is the user API to query {@link Resource Resources} in Strolch. The {@link Navigation} is used @@ -29,62 +28,21 @@ import li.strolch.model.visitor.NoStrategyResourceVisitor; * * @author Robert von Burg */ -public class ResourceQuery extends StrolchQuery { - - private ResourceVisitor elementVisitor; +public class ResourceQuery extends StrolchQuery { /** - * Create a new - * * @param navigation * @param elementVisitor */ - public ResourceQuery(Navigation navigation, ResourceVisitor elementVisitor) { + public ResourceQuery(Navigation navigation) { super(navigation); - this.elementVisitor = elementVisitor; } - /** - * @return the elementVisitor - */ - public ResourceVisitor getElementVisitor() { - return this.elementVisitor; + public static ResourceQuery query(Navigation navigation) { + return new ResourceQuery(navigation); } - /** - * Returns an instance of {@link ResourceQuery} where the visitor used is the {@link NoStrategyResourceVisitor} thus - * returning the actual Resource, i.e. no transformation is performed - * - * @param navigation - * @return - */ - public static ResourceQuery query(Navigation navigation) { - return new ResourceQuery(navigation, new NoStrategyResourceVisitor()); - } - - /** - * Returns an instance of {@link ResourceQuery} where the visitor used is the {@link NoStrategyResourceVisitor} thus - * returning the actual Resource, i.e. no transformation is performed - * - * @param type - * the type of {@link Resource} to navigate to - * @return - */ - public static ResourceQuery query(String type) { - return new ResourceQuery(new StrolchTypeNavigation(type), new NoStrategyResourceVisitor()); - } - - /** - * Returns an instance of {@link ResourceQuery} using the given {@link ResourceVisitor} thus performing the given - * transformation - * - * @param type - * the type of Order to navigate to - * @param resourceVisitor - * the visitor to use for transformation - * @return - */ - public static ResourceQuery query(String type, ResourceVisitor resourceVisitor) { - return new ResourceQuery(new StrolchTypeNavigation(type), resourceVisitor); + public static ResourceQuery query(String type) { + return new ResourceQuery(new StrolchTypeNavigation(type)); } }