unified javadocs

This commit is contained in:
Timo Westkämper 2008-04-06 13:59:23 +00:00
parent 2de4a20af5
commit a3fbcb90d6
20 changed files with 145 additions and 47 deletions

View File

@ -9,8 +9,8 @@ import com.mysema.query.grammar.Grammar;
import com.mysema.query.grammar.types.Expr;
/**
* CascadingBoolean provides
*
* CascadingBoolean provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -8,12 +8,10 @@ package com.mysema.query;
import com.mysema.query.grammar.types.Expr;
/**
* JoinExpression provides.
*
* JoinExpression provides
*
* @author tiwe
* @version $Id$
*
*/
public class JoinExpression {
private Expr.Boolean condition;

View File

@ -6,12 +6,10 @@
package com.mysema.query;
/**
* JoinType provides.
*
* JoinType provides
*
* @author tiwe
* @version $Id$
*
*/
public enum JoinType {
DEFAULT, INNERJOIN, JOIN, LEFTJOIN, FULLJOIN

View File

@ -11,8 +11,8 @@ import com.mysema.query.grammar.types.Expr;
import static com.mysema.query.grammar.types.Expr.*;
/**
* Query provides a the query interface of the fluent query DSL
*
* Query provides a the query interface of the fluent query DSL.
*
* @author tiwe
* @version $Id$
*/

View File

@ -14,8 +14,8 @@ import com.mysema.query.grammar.types.Expr;
import static com.mysema.query.grammar.types.Expr.*;
/**
* QueryBase provides a basic implementation of the Query interface
*
* QueryBase provides a basic implementation of the Query interface.
*
* @author tiwe
* @version $Id$
*/
@ -103,6 +103,9 @@ public class QueryBase<A extends QueryBase<A>> implements Query<A> {
return metadata;
}
/**
* The Class Metadata.
*/
public class Metadata{
public List<Expr<?>> getGroupBy() {
return groupBy;

View File

@ -14,7 +14,7 @@ import com.mysema.query.grammar.types.CollectionType;
import com.mysema.query.grammar.types.Expr;
/**
* Grammar provides the factory methods for the fluent grammar
* Grammar provides the factory methods for the fluent grammar.
*
* @author tiwe
* @version $Id$

View File

@ -6,13 +6,16 @@
package com.mysema.query.grammar;
/**
* Ops provides the operators for the fluent query grammar
*
* Ops provides the operators for the fluent query grammar.
*
* @author tiwe
* @version $Id$
*/
public interface Ops {
/**
* The Class Op.
*/
public static class Op<RT>{}
// general

View File

@ -6,12 +6,10 @@
package com.mysema.query.grammar;
/**
* Order provides.
*
* Order provides
*
* @author tiwe
* @version $Id$
*
*/
public enum Order {
ASC, DESC

View File

@ -9,13 +9,11 @@ import com.mysema.query.grammar.types.Expr;
/**
* OrderSpecifier provides.
*
* OrderSpecifier provides
*
* @param <A> *
* @author tiwe
* @version $Id$
*
* @param <A>
*/
public class OrderSpecifier<A extends Comparable<A>> {
public Order order;

View File

@ -6,8 +6,8 @@
package com.mysema.query.grammar.types;
/**
* Alias provides
*
* Alias provides.
*
* @author tiwe
* @version $Id$
*/
@ -15,6 +15,9 @@ public interface Alias {
Expr<?> getFrom();
/**
* The Class Entity.
*/
public static class Entity<D> extends Expr.Entity<D> implements ToPath{
private final Expr<?> from;
private final Path<?> to;
@ -27,6 +30,9 @@ public interface Alias {
public Path<?> getTo() {return to;}
}
/**
* The Class EntityCollection.
*/
public static class EntityCollection<D> extends Expr.Entity<D> implements ToPath{
private final Expr<?> from;
private final Path<?> to;
@ -39,6 +45,9 @@ public interface Alias {
public Path<?> getTo() {return to;}
}
/**
* The Class Simple.
*/
public static class Simple<D> extends Expr.Simple<D> implements Alias{
private final Expr<?> from;
private final java.lang.String to;
@ -54,6 +63,9 @@ public interface Alias {
public java.lang.String getTo() {return to;}
}
/**
* The Interface ToPath.
*/
public interface ToPath extends Alias{
Path<?> getTo();
}

View File

@ -6,8 +6,8 @@
package com.mysema.query.grammar.types;
/**
* CollectionType provides
*
* CollectionType provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -8,8 +8,8 @@ package com.mysema.query.grammar.types;
import com.mysema.query.grammar.OrderSpecifier;
/**
* Expr provides
*
* Expr provides.
*
* @author tiwe
* @version $Id$
*/
@ -23,12 +23,18 @@ public abstract class Expr<D> {
public Boolean ne(D right){return IntGrammar.ne(this, right);}
public Boolean ne(Expr<? super D> right){return IntGrammar.ne(this, right);}
/**
* The Class Boolean.
*/
public static abstract class Boolean extends Literal<java.lang.Boolean>{
public Boolean() {super(java.lang.Boolean.class);}
public Boolean and(Boolean right) {return IntGrammar.and(this, right);}
public Boolean or(Boolean right) {return IntGrammar.or(this, right);}
}
/**
* The Class Comparable.
*/
public static abstract class Comparable<D extends java.lang.Comparable<D>> extends Literal<D>{
public Comparable(Class<D> type) {super(type);}
public Boolean after(D right) {return IntGrammar.after(this,right);}
@ -55,6 +61,9 @@ public abstract class Expr<D> {
public Boolean notIn(CollectionType<D> arg) {return IntGrammar.notIn(this, arg);}
}
/**
* The Class Constant.
*/
public static class Constant<D> extends Expr<D>{
private final D constant;
@SuppressWarnings("unchecked")
@ -74,23 +83,38 @@ public abstract class Expr<D> {
// -,
// +
/**
* The Class Entity.
*/
public static abstract class Entity<D> extends Expr<D>{
public Entity(Class<D> type) {super(type);}
}
/**
* The Class Simple.
*/
public static abstract class Simple<D> extends Expr<D>{
public Simple(Class<D> type) {super(type);}
public Expr<D> as(java.lang.String to){return IntGrammar.as(this, to);}
}
/**
* The Class Embeddable.
*/
public static abstract class Embeddable<D> extends Simple<D>{
public Embeddable(Class<D> type) {super(type);}
}
/**
* The Class Literal.
*/
public static abstract class Literal<D> extends Simple<D>{
public Literal(Class<D> type) {super(type);}
}
/**
* The Class String.
*/
public static abstract class String extends Comparable<java.lang.String>{
public String() {super(java.lang.String.class);}
public String concat(Expr<java.lang.String> str) {return IntGrammar.concat(this, str);}

View File

@ -8,8 +8,8 @@ package com.mysema.query.grammar.types;
import com.mysema.query.grammar.Ops.Op;
/**
* Factory provides
*
* Factory provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -10,8 +10,8 @@ import com.mysema.query.grammar.Ops.Op;
/**
* Operation provides
*
* Operation provides.
*
* @author tiwe
* @version $Id$
*/
@ -20,6 +20,9 @@ public interface Operation<OP,RT> {
Expr<?>[] getArgs();
Op<OP> getOperator();
/**
* The Class Boolean.
*/
public static class Boolean extends Expr.Boolean implements Operation<java.lang.Boolean,java.lang.Boolean>{
private final Expr<?>[] args;
private final Op<java.lang.Boolean> op;
@ -31,6 +34,9 @@ public interface Operation<OP,RT> {
public Op<java.lang.Boolean> getOperator() {return op;}
}
/**
* The Class Comparable.
*/
public static class Comparable<OpType,D extends java.lang.Comparable<D>> extends Expr.Comparable<D> implements Operation<OpType,D> {
private final Expr<?>[] args;
private final Op<OpType> op;
@ -43,12 +49,18 @@ public interface Operation<OP,RT> {
public Op<OpType> getOperator() {return op;}
}
/**
* The Class Number.
*/
public static class Number<N extends java.lang.Number,D extends java.lang.Comparable<D>> extends Comparable<N,D>{
public Number(Op<N> op, Expr<?>[] args) {
super(op, args);
}
}
/**
* The Class String.
*/
public static class String extends Expr.String implements Operation<java.lang.String,java.lang.String>{
private final Expr<?>[] args;
private final Op<java.lang.String> op;

View File

@ -13,8 +13,8 @@ import static com.mysema.query.grammar.types.PathMetadata.forVariable;
/**
* Path provides
*
* Path provides.
*
* @author tiwe
* @version $Id$
*/
@ -24,6 +24,9 @@ public interface Path<C> {
Expr.Boolean isnotnull();
Expr.Boolean isnull();
/**
* The Class Boolean.
*/
public static class Boolean extends Expr.Boolean implements Path<java.lang.Boolean>{
private final PathMetadata<java.lang.String> metadata;
public Boolean(PathMetadata<java.lang.String> metadata) {
@ -34,11 +37,17 @@ public interface Path<C> {
public Expr.Boolean isnull() {return IntGrammar.isnull(this);}
}
/**
* The Interface Collection.
*/
public interface Collection<D> extends Path<java.util.Collection<D>>, CollectionType<D>{
Class<D> getElementType();
Expr.Comparable<Integer> size();
}
/**
* The Class Comparable.
*/
public static class Comparable<D extends java.lang.Comparable<D>> extends Expr.Comparable<D> implements Path<D>{
private final PathMetadata<?> metadata;
public Comparable(Class<D> type, PathMetadata<?> metadata) {
@ -50,6 +59,9 @@ public interface Path<C> {
public Expr.Boolean isnull() {return IntGrammar.isnull(this);}
}
/**
* The Class ComponentCollection.
*/
public static class ComponentCollection<D> extends Expr.Simple<java.util.Collection<D>> implements Collection<D>{
private final PathMetadata<?> metadata;
protected final Class<D> type;
@ -67,6 +79,9 @@ public interface Path<C> {
}
}
/**
* The Class ComponentList.
*/
public static class ComponentList<D> extends ComponentCollection<D> implements List<D>{
public ComponentList(Class<D> type, PathMetadata<?> metadata) {
super(type, metadata);
@ -79,6 +94,9 @@ public interface Path<C> {
}
}
/**
* The Class ComponentMap.
*/
public static class ComponentMap<K,V> extends Expr.Simple<java.util.Map<K,V>> implements Map<K,V>{
private final Class<K> keyType;
private final PathMetadata<?> metadata;
@ -102,6 +120,9 @@ public interface Path<C> {
public Expr.Boolean isnull() {return IntGrammar.isnull(this);}
}
/**
* The Class Entity.
*/
public static class Entity<D> extends Expr.Entity<D> implements Path<D>{
private final PathMetadata<?> metadata;
public Entity(Class<D> type, java.lang.String localName) {
@ -149,6 +170,9 @@ public interface Path<C> {
public <B extends D> Expr.Boolean typeOf(Class<B> type) {return IntGrammar.typeOf(this, type);}
}
/**
* The Class EntityCollection.
*/
public static class EntityCollection<D> extends Expr.Entity<java.util.Collection<D>> implements Collection<D>{
private final PathMetadata<?> metadata;
protected final Class<D> type;
@ -168,6 +192,9 @@ public interface Path<C> {
}
}
/**
* The Class EntityList.
*/
public static class EntityList<D> extends EntityCollection<D> implements List<D>{
public EntityList(Class<D> type, PathMetadata<?> metadata) {
super(type, metadata);
@ -180,6 +207,9 @@ public interface Path<C> {
}
}
/**
* The Class EntityMap.
*/
public static class EntityMap<K,V> extends Expr.Entity<Map<K,V>> implements Map<K,V>{
private final Class<K> keyType;
private final PathMetadata<?> metadata;
@ -203,11 +233,17 @@ public interface Path<C> {
public Expr.Boolean isnull() {return IntGrammar.isnull(this);}
}
/**
* The Interface List.
*/
public interface List<D> extends Collection<D>{
Expr<D> get(Expr<Integer> index);
Expr<D> get(int index);
}
/**
* The Interface Map.
*/
public interface Map<K,V> extends Path<java.util.Map<K,V>>{
Expr<V> get(Expr<K> key);
Expr<V> get(K key);
@ -215,11 +251,17 @@ public interface Path<C> {
Class<V> getValueType();
}
/**
* The Class RenamableEntity.
*/
public static class RenamableEntity<D> extends Entity<D>{
protected RenamableEntity(Class<D> type, PathMetadata<?> metadata) {super(type, metadata);}
public Alias.Entity<D> as(Path.Entity<D> to) {return IntGrammar.as(this, to);}
}
/**
* The Class Simple.
*/
public static class Simple<D> extends Expr.Simple<D> implements Path<D>{
private final PathMetadata<?> metadata;
public <T> Simple(Class<D> type, PathMetadata<?> metadata) {
@ -231,6 +273,9 @@ public interface Path<C> {
public Expr.Boolean isnull() {return IntGrammar.isnull(this);}
}
/**
* The Class String.
*/
public static class String extends Expr.String implements Path<java.lang.String>{
private final PathMetadata<java.lang.String> metadata;
public String(PathMetadata<java.lang.String> metadata) {

View File

@ -8,12 +8,10 @@ package com.mysema.query.grammar.types;
import com.mysema.query.grammar.Ops;
/**
*
* PathMetadata provides metadata for Path expressions
* PathMetadata provides metadata for Path expressions.
*
* @author tiwe
* @version $Id$
*
*/
public final class PathMetadata<T> {
private final Expr<T> expression;
@ -74,6 +72,9 @@ public final class PathMetadata<T> {
return pathType;
}
/**
* The Class PathType.
*/
public static class PathType extends Ops.Op<Path<?>> {}
// bookmark.tags.size

View File

@ -13,7 +13,7 @@ import org.apache.commons.collections15.Transformer;
import org.apache.commons.collections15.map.LazyMap;
/**
* Visitor provides a dispatching Visitor for Expr instances
* Visitor provides a dispatching Visitor for Expr instances.
*
* @author tiwe
* @version $Id$

View File

@ -9,7 +9,7 @@ package com.mysema.query.grammar.types;
/**
* VisitorAdapter provides a base implementation where invocations are
* dispatched to supertypes when available and visible
* dispatched to supertypes when available and visible.
*
* @author tiwe
* @version $Id$
@ -24,10 +24,6 @@ public abstract class VisitorAdapter<V extends VisitorAdapter<V>> extends Visito
protected void visit(Alias.EntityCollection<?> expr) {
visit((Alias.ToPath) expr);
}
// @Override
// protected void visit(Alias.Literal<?> expr) {
// visit((Alias.Simple) expr);
// }
@Override
protected void visit(Operation.Boolean expr) {
visit((Operation<?, ?>) expr);

View File

@ -1,3 +1,8 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.grammar;
import java.util.ArrayList;
@ -14,8 +19,8 @@ import com.mysema.query.grammar.types.Visitor;
/**
* VisitorTest provides
*
* VisitorTest provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -1,3 +1,8 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.grammar.types;
import static org.junit.Assert.*;
@ -6,8 +11,8 @@ import org.junit.Test;
/**
* TypesTest provides
*
* TypesTest provides.
*
* @author tiwe
* @version $Id$
*/