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 81e025f commit b30fd2a
Show file tree
Hide file tree
Showing 82 changed files with 6,535 additions and 5,617 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,48 @@
import java.util.List;

public abstract class AbstractMethodInvokeImpl<O extends JavaSource<O>,
P extends ExpressionHolder<O>,
M extends MethodInvokeExpression<O,P,M>,
J extends org.eclipse.jdt.core.dom.Expression>
extends InvokeableImpl<O,P,M,J>
implements MethodInvokeExpression<O,P,M>,
ArgumentHolder<O,P,M> {

protected List<Argument<O, M, ?>> arguments = Collections.EMPTY_LIST;

public AbstractMethodInvokeImpl( String method ) {
super( method );
}

@Override
public M addArgument( Argument<?,?,?> argument ) {
if ( arguments.isEmpty() ) {
arguments = new LinkedList<Argument<O, M, ?>>();
}
arguments.add( (Argument<O, M, ?>) argument );
return (M) this;
}

@Override
public ExpressionSource<O, M, ?> getTarget() {
return this.target;
}

@Override
public M setTarget( ExpressionSource<?,?,?> target ) {
this.target = (ExpressionSource<O, M, ?>) target;
return (M) this;
}

@Override
public List<Argument<O, M, ?>> getArguments() {
return Collections.unmodifiableList( arguments );
}
P extends ExpressionHolder<O>,
M extends MethodInvokeExpression<O,P,M>,
J extends org.eclipse.jdt.core.dom.Expression>
extends InvokeableImpl<O,P,M,J>
implements MethodInvokeExpression<O,P,M>,
ArgumentHolder<O,P,M>
{

protected List<Argument<O,M,?>> arguments = Collections.EMPTY_LIST;

public AbstractMethodInvokeImpl(String method)
{
super(method);
}

@Override
public M addArgument(Argument<?,?,?> argument)
{
if (arguments.isEmpty())
{
arguments = new LinkedList<Argument<O,M,?>>();
}
arguments.add((Argument<O,M,?>) argument);
return (M) this;
}

@Override
public ExpressionSource<O,M,?> getTarget()
{
return this.target;
}

@Override
public M setTarget(ExpressionSource<?,?,?> target)
{
this.target = (ExpressionSource<O,M,?>) target;
return (M) this;
}

@Override
public List<Argument<O,M,?>> getArguments()
{
return Collections.unmodifiableList(arguments);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,46 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public abstract class AccessorImpl<O extends JavaSource<O>,
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,E>,
J extends org.eclipse.jdt.core.dom.Expression>
extends NonPrimitiveExpressionImpl<O,P,E,J>
implements Accessor<O,P,E> {

public Field<O,E> field( String fieldName ) {
return new DotAccessorImpl<O,P,E>( this ).field( fieldName );
}

public Getter<O,E> getter( String field, String klass ) {
return new DotAccessorImpl<O,P,E>( this ).getter( field, klass );
}

public Getter<O,E> getter( String field, Class klass ) {
return new DotAccessorImpl<O,P,E>( this ).getter( field, klass );
}

public Setter<O,E> setter( String fldName, String type, ExpressionSource<?,?,?> value ) {
return new DotAccessorImpl<O,P,E>( this ).setter( fldName, type, value );
}

public Setter<O,E> setter( String fldName, Class type, ExpressionSource<?,?,?> value ) {
return new DotAccessorImpl<O,P,E>( this ).setter( fldName, type, value );
}

public MethodCallExpression<O,E> invoke( String method ) {
return new DotAccessorImpl<O,P,E>( this ).invoke( method );
}

@Override
public ArrayIndexer<O,E> itemAt( ExpressionSource<?,?,?> index ) {
return new DotAccessorImpl<O,P,E>( this ).itemAt( index );
}
P extends ExpressionHolder<O>,
E extends NonPrimitiveExpression<O,P,E>,
J extends org.eclipse.jdt.core.dom.Expression>
extends NonPrimitiveExpressionImpl<O,P,E,J>
implements Accessor<O,P,E>
{

public Field<O,E> field(String fieldName)
{
return new DotAccessorImpl<O,P,E>(this).field(fieldName);
}

public Getter<O,E> getter(String field, String klass)
{
return new DotAccessorImpl<O,P,E>(this).getter(field, klass);
}

public Getter<O,E> getter(String field, Class klass)
{
return new DotAccessorImpl<O,P,E>(this).getter(field, klass);
}

public Setter<O,E> setter(String fldName, String type, ExpressionSource<?,?,?> value)
{
return new DotAccessorImpl<O,P,E>(this).setter(fldName, type, value);
}

public Setter<O,E> setter(String fldName, Class type, ExpressionSource<?,?,?> value)
{
return new DotAccessorImpl<O,P,E>(this).setter(fldName, type, value);
}

public MethodCallExpression<O,E> invoke(String method)
{
return new DotAccessorImpl<O,P,E>(this).invoke(method);
}

@Override
public ArrayIndexer<O,E> itemAt(ExpressionSource<?,?,?> index)
{
return new DotAccessorImpl<O,P,E>(this).itemAt(index);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,69 +15,81 @@
import org.jboss.forge.roaster.model.source.JavaSource;

public class ArrayAccessImpl<O extends JavaSource<O>,
P extends ExpressionHolder<O>>
extends SimpleAccessorImpl<O,P,ArrayIndexer<O,P>,ArrayAccess>
implements ArrayIndexer<O,P> {
P extends ExpressionHolder<O>>
extends SimpleAccessorImpl<O,P,ArrayIndexer<O,P>,ArrayAccess>
implements ArrayIndexer<O,P>
{

private ExpressionSource<O,ArrayIndexer<O,P>,?> index;
private ExpressionSource<O,ArrayIndexer<O,P>,?> target;
private ArrayAccess axx;
private ExpressionSource<O,ArrayIndexer<O,P>,?> index;
private ExpressionSource<O,ArrayIndexer<O,P>,?> target;
private ArrayAccess axx;

public ArrayAccessImpl( ExpressionSource<?,?,?> index ) {
ExpressionSource<O,ArrayIndexer<O,P>,?> cast = (ExpressionSource<O, ArrayIndexer<O, P>, ?>) index;
this.index = cast;
}
public ArrayAccessImpl(ExpressionSource<?,?,?> index)
{
ExpressionSource<O,ArrayIndexer<O,P>,?> cast = (ExpressionSource<O,ArrayIndexer<O,P>,?>) index;
this.index = cast;
}

@Override
public ArrayAccess materialize( AST ast ) {
if (isMaterialized()) {
return axx;
}
axx = ast.newArrayAccess();
axx.setIndex( wireAndGetExpression( index, this, ast ) );
if ( target != null ) {
axx.setArray( wireAndGetExpression( target, this, ast ) );
}
return axx;
}
@Override
public ArrayAccess materialize(AST ast)
{
if (isMaterialized())
{
return axx;
}
axx = ast.newArrayAccess();
axx.setIndex(wireAndGetExpression(index, this, ast));
if (target != null)
{
axx.setArray(wireAndGetExpression(target, this, ast));
}
return axx;
}

@Override
public ArrayAccess getInternal() {
return axx;
}
@Override
public ArrayAccess getInternal()
{
return axx;
}

@Override
public void setInternal(ArrayAccess jdtNode) {
super.setInternal(jdtNode);
this.axx = jdtNode;
}
@Override
public void setInternal(ArrayAccess jdtNode)
{
super.setInternal(jdtNode);
this.axx = jdtNode;
}

@Override
public ExpressionSource<O,ArrayIndexer<O,P>,?> chainExpression( ExpressionSource<O, ?, ?> child ) {
ExpressionSource<O,ArrayIndexer<O,P>,?> cast = ( ExpressionSource<O,ArrayIndexer<O,P>,?> ) child;
this.target = cast;
return cast;
}
@Override
public ExpressionSource<O,ArrayIndexer<O,P>,?> chainExpression(ExpressionSource<O,?,?> child)
{
ExpressionSource<O,ArrayIndexer<O,P>,?> cast = (ExpressionSource<O,ArrayIndexer<O,P>,?>) child;
this.target = cast;
return cast;
}

@Override
public ExpressionSource<O, ArrayIndexer<O, P>, ?> getIndex() {
return index;
}
@Override
public ExpressionSource<O,ArrayIndexer<O,P>,?> getIndex()
{
return index;
}

@Override
public ArrayIndexer<O, P> setIndex( ExpressionSource<?, ?, ?> index ) {
this.index = (ExpressionSource<O, ArrayIndexer<O, P>, ?>) index;
return this;
}
@Override
public ArrayIndexer<O,P> setIndex(ExpressionSource<?,?,?> index)
{
this.index = (ExpressionSource<O,ArrayIndexer<O,P>,?>) index;
return this;
}

@Override
public ExpressionSource<O, ArrayIndexer<O, P>, ?> getTarget() {
return target;
}
@Override
public ExpressionSource<O,ArrayIndexer<O,P>,?> getTarget()
{
return target;
}

@Override
public ArrayIndexer<O, P> setTarget( ExpressionSource<?, ?, ?> target ) {
this.target = (ExpressionSource<O, ArrayIndexer<O, P>, ?>) target;
return this;
}
@Override
public ArrayIndexer<O,P> setTarget(ExpressionSource<?,?,?> target)
{
this.target = (ExpressionSource<O,ArrayIndexer<O,P>,?>) target;
return this;
}
}
Loading

0 comments on commit b30fd2a

Please sign in to comment.