Skip to content

Commit

Permalink
[ROASTER-11] Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
sotty committed Jul 25, 2015
1 parent b30fd2a commit 72450f4
Show file tree
Hide file tree
Showing 77 changed files with 1,028 additions and 870 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public interface AccessBuilder<O extends JavaSource<O>,
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,E>> {
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,E>>
{

public Field<O,E> field( String field );
public Field<O,E> field(String field);

public Getter<O,E> getter( String field, String klass );
public Getter<O,E> getter(String field, String klass);

public Getter<O,E> getter( String field, Class klass );
public Getter<O,E> getter(String field, Class klass);

public Setter<O,E> setter( String fldName, String type, ExpressionSource<?,?,?> value );
public Setter<O,E> setter(String fldName, String type, ExpressionSource<?,?,?> value);

public Setter<O,E> setter( String fldName, Class type, ExpressionSource<?,?,?> value );
public Setter<O,E> setter(String fldName, Class type, ExpressionSource<?,?,?> value);

public MethodCallExpression<O,E> invoke( String method );
public MethodCallExpression<O,E> invoke(String method);

public ArrayIndexer<O,E> itemAt( ExpressionSource<?,?,?> index );
public ArrayIndexer<O,E> itemAt(ExpressionSource<?,?,?> index);

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public interface Accessor<O extends JavaSource<O>,
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,E>>
extends Argument<O,P,E>,
AccessBuilder<O,P,E> {
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,E>>
extends Argument<O,P,E>,
AccessBuilder<O,P,E>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public interface Argument<O extends JavaSource<O>,
P extends ExpressionHolder<O>,
E extends ExpressionSource<O,P,E>>
extends ExpressionSource<O,P,E> {
P extends ExpressionHolder<O>,
E extends ExpressionSource<O,P,E>>
extends ExpressionSource<O,P,E>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
import java.util.List;

public interface ArgumentHolder<O extends JavaSource<O>,
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,?>>
extends ExpressionHolder<O> {
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,?>>
extends ExpressionHolder<O>
{

public E addArgument( Argument<?,?,?> arg );
public E addArgument(Argument<?,?,?> arg);

public List<Argument<O,E,?>> getArguments();
public List<Argument<O,E,?>> getArguments();
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
import java.util.List;

public interface ArrayConstructorExpression<O extends JavaSource<O>,
P extends ExpressionHolder<O>>
extends Argument<O,P,ArrayConstructorExpression<O,P>>,
NonPrimitiveExpression<O,P,ArrayConstructorExpression<O,P>> {
P extends ExpressionHolder<O>>
extends Argument<O,P,ArrayConstructorExpression<O,P>>,
NonPrimitiveExpression<O,P,ArrayConstructorExpression<O,P>>
{

public ArrayConstructorExpression<O,P> addDimension( ExpressionSource<?,?,?> dim );
public ArrayConstructorExpression<O,P> addDimension(ExpressionSource<?,?,?> dim);

public ArrayConstructorExpression<O,P> init( ArrayInit<?,?> array );
public ArrayConstructorExpression<O,P> init(ArrayInit<?,?> array);

public ArrayInit<O,ArrayConstructorExpression<O,P>> getInit();
public ArrayInit<O,ArrayConstructorExpression<O,P>> getInit();

public List<ExpressionSource<O,ArrayConstructorExpression<O,P>,?>> getDimensions();
public List<ExpressionSource<O,ArrayConstructorExpression<O,P>,?>> getDimensions();

public int getDimension();
public int getDimension();
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
import org.jboss.forge.roaster.model.ExpressionHolder;
import org.jboss.forge.roaster.model.source.JavaSource;

public interface ArrayIndexer<O extends JavaSource<O>,P extends ExpressionHolder<O>>
extends OrdinalArgument<O,P,ArrayIndexer<O,P>>,
NonPrimitiveExpression<O,P,ArrayIndexer<O,P>> {
public interface ArrayIndexer<O extends JavaSource<O>, P extends ExpressionHolder<O>>
extends OrdinalArgument<O,P,ArrayIndexer<O,P>>,
NonPrimitiveExpression<O,P,ArrayIndexer<O,P>>
{

public ExpressionSource<O,ArrayIndexer<O,P>,?> getIndex();
public ExpressionSource<O,ArrayIndexer<O,P>,?> getIndex();

public ArrayIndexer<O,P> setIndex( ExpressionSource<?,?,?> index );
public ArrayIndexer<O,P> setIndex(ExpressionSource<?,?,?> index);

public ExpressionSource<O,ArrayIndexer<O,P>,?> getTarget();
public ExpressionSource<O,ArrayIndexer<O,P>,?> getTarget();

public ArrayIndexer<O,P> setTarget( ExpressionSource<?,?,?> target );
public ArrayIndexer<O,P> setTarget(ExpressionSource<?,?,?> target);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@

import java.util.List;

public interface ArrayInit<O extends JavaSource<O>,P extends ExpressionHolder<O>>
extends ExpressionSource<O,P,ArrayInit<O,P>>,
NonPrimitiveExpression<O,P,ArrayInit<O,P>> {
public interface ArrayInit<O extends JavaSource<O>, P extends ExpressionHolder<O>>
extends ExpressionSource<O,P,ArrayInit<O,P>>,
NonPrimitiveExpression<O,P,ArrayInit<O,P>>
{

public ArrayInit<O,P> addElement( ArrayInit<?,?> subRow );
public ArrayInit<O,P> addElement(ArrayInit<?,?> subRow);

public ArrayInit<O,P> addElement( ExpressionSource<?,?,?> subElement );
public ArrayInit<O,P> addElement(ExpressionSource<?,?,?> subElement);

public List<ExpressionSource<O,ArrayInit<O,P>,?>> getElements();
public List<ExpressionSource<O,ArrayInit<O,P>,?>> getElements();

public int size();
public int size();

public int getDimension();
public int getDimension();

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public interface AssignExpression<O extends JavaSource<O>,
P extends ExpressionHolder<O>>
extends NonPrimitiveExpression<O,P,AssignExpression<O,P>>,
Argument<O,P,AssignExpression<O,P>> {
P extends ExpressionHolder<O>>
extends NonPrimitiveExpression<O,P,AssignExpression<O,P>>,
Argument<O,P,AssignExpression<O,P>>
{

public String getOperator();
public String getOperator();

public AssignExpression<O,P> setOperator( Assignment op );
public AssignExpression<O,P> setOperator(Assignment op);

public Accessor<O,AssignExpression<O,P>,?> getLeft();
public Accessor<O,AssignExpression<O,P>,?> getLeft();

public AssignExpression<O,P> setLeft( Accessor<?,?,?> left );
public AssignExpression<O,P> setLeft(Accessor<?,?,?> left);

public ExpressionSource<O,AssignExpression<O,P>,?> getRight();
public ExpressionSource<O,AssignExpression<O,P>,?> getRight();

public AssignExpression<O,P> setRight( ExpressionSource<?,?,?> right );
public AssignExpression<O,P> setRight(ExpressionSource<?,?,?> right);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,46 @@

package org.jboss.forge.roaster.model.expressions;

public enum Assignment {

ASSIGN( "=" ),
DIVIDE_ASSIGN( "/=" ),
PLUS_ASSIGN( "+=" ),
MINUS_ASSIGN( "-=" ),
TIMES_ASSIGN( "*=" ),
REMAINDER_ASSIGN( "%=" ),

LEFT_SHIFT_ASSIGN( "<<=" ),
RIGHT_SHIFT_ASSIGN( ">>=" ),
RIGHT_SHIFT_UNSIGNED_ASSIGN( ">>>=" ),
BITWISE_XOR_ASSIGN( "^=" ),
BITWISE_AND_ASSIGN( "&=" ),
BITWISE_OR_ASSIGN( "|=" );

private String op;

Assignment( String o ) {
op = o;
}

public String getOp() {
return op;
}


public static Assignment build( String x ) {
for ( Assignment en : Assignment.values() ) {
if ( en.getOp().equals( x ) ) {
return en;
}
}
throw new IllegalStateException( "Unrecognized operation " + x );
}
public enum Assignment
{

ASSIGN("="),
DIVIDE_ASSIGN("/="),
PLUS_ASSIGN("+="),
MINUS_ASSIGN("-="),
TIMES_ASSIGN("*="),
REMAINDER_ASSIGN("%="),

LEFT_SHIFT_ASSIGN("<<="),
RIGHT_SHIFT_ASSIGN(">>="),
RIGHT_SHIFT_UNSIGNED_ASSIGN(">>>="),
BITWISE_XOR_ASSIGN("^="),
BITWISE_AND_ASSIGN("&="),
BITWISE_OR_ASSIGN("|=");

private String op;

Assignment(String o)
{
op = o;
}

public String getOp()
{
return op;
}


public static Assignment build(String x)
{
for (Assignment en : Assignment.values())
{
if (en.getOp().equals(x))
{
return en;
}
}
throw new IllegalStateException("Unrecognized operation " + x);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,46 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public interface BasicExpressionFactory<O extends JavaSource<O>,
P extends ExpressionHolder<O>>
extends LiteralBuilder<O,P>,
ConstructorBuilder<O,P> {
P extends ExpressionHolder<O>>
extends LiteralBuilder<O,P>,
ConstructorBuilder<O,P>
{

public Variable<O,P> var( String varName );
public Variable<O,P> var(String varName);

public OperatorExpression<O,P> operator( Op op );
public OperatorExpression<O,P> operator(Op op);

public UnaryExpression<O,P> operator( PrefixOp operator, Argument<O,?,?> arg );
public UnaryExpression<O,P> operator(PrefixOp operator, Argument<O,?,?> arg);

public TernaryExpression<O,P> ternary();
public TernaryExpression<O,P> ternary();

public CastExpression<O,P> cast( String klass, ExpressionSource<O,?,?> arg );
public CastExpression<O,P> cast(String klass, ExpressionSource<O,?,?> arg);

public CastExpression<O,P> cast( Class klass, ExpressionSource<O,?,?> arg );
public CastExpression<O,P> cast(Class klass, ExpressionSource<O,?,?> arg);

public ParenExpression<O,P> paren( ExpressionSource<O,?,?> inner );
public ParenExpression<O,P> paren(ExpressionSource<O,?,?> inner);

public UnaryExpression<O,P> not( Argument<O,?,?> arg );
public UnaryExpression<O,P> not(Argument<O,?,?> arg);

public AssignExpression<O,P> assign( Assignment operator );
public AssignExpression<O,P> assign(Assignment operator);

public DeclareExpression<O,P> declare( String klass, String name );
public DeclareExpression<O,P> declare(String klass, String name);

public DeclareExpression<O,P> declare( Class klass, String name );
public DeclareExpression<O,P> declare(Class klass, String name);

public DeclareExpression<O,P> declare( String klass, String name, ExpressionSource<O,?,?> init );
public DeclareExpression<O,P> declare(String klass, String name, ExpressionSource<O,?,?> init);

public DeclareExpression<O,P> declare( Class klass, String name, ExpressionSource<O,?,?> init );
public DeclareExpression<O,P> declare(Class klass, String name, ExpressionSource<O,?,?> init);

public Accessor<O,P,?> classStatic( String klass );
public Accessor<O,P,?> classStatic(String klass);

public Accessor<O,P,?> classStatic( Class klass );
public Accessor<O,P,?> classStatic(Class klass);

public InstanceofExpression<O,P> instanceOf( String klass, ExpressionSource<O,?,?> arg );
public InstanceofExpression<O,P> instanceOf(String klass, ExpressionSource<O,?,?> arg);

public InstanceofExpression<O,P> instanceOf( Class klass, ExpressionSource<O,?,?> arg );
public InstanceofExpression<O,P> instanceOf(Class klass, ExpressionSource<O,?,?> arg);

public Super<O,P> sup();
public Super<O,P> sup();

public ArrayInit<O,ArrayConstructorExpression<O,P>> vec();
public ArrayInit<O,ArrayConstructorExpression<O,P>> vec();
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public interface BooleanLiteral<O extends JavaSource<O>,
P extends ExpressionHolder<O>>
extends PrimitiveLiteral<O,P> {
P extends ExpressionHolder<O>>
extends PrimitiveLiteral<O,P>
{

public Boolean getValue();
public Boolean getValue();
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public interface CastExpression<O extends JavaSource<O>,
P extends ExpressionHolder<O>>
extends Argument<O,P,CastExpression<O,P>>,
NonPrimitiveExpression<O,P,CastExpression<O,P>> {
P extends ExpressionHolder<O>>
extends Argument<O,P,CastExpression<O,P>>,
NonPrimitiveExpression<O,P,CastExpression<O,P>>
{

public String getType();
public String getType();

public ExpressionSource<O,CastExpression<O,P>,?> getExpression();
public ExpressionSource<O,CastExpression<O,P>,?> getExpression();
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@


public interface ChainableExpression<O extends JavaSource<O>,
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,E>>
extends NonPrimitiveExpression<O,P,E> {
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,E>>
extends NonPrimitiveExpression<O,P,E>
{

public Accessor<O,P,E> dot();
public Accessor<O,P,E> dot();

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public interface CharacterLiteral<O extends JavaSource<O>,
P extends ExpressionHolder<O>>
extends PrimitiveLiteral<O,P> {
P extends ExpressionHolder<O>>
extends PrimitiveLiteral<O,P>
{

public Character getValue();
public Character getValue();
}
Loading

0 comments on commit 72450f4

Please sign in to comment.