de.hunsicker.jalopy.printer.AssignmentOperatorPrinter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jalopy Show documentation
Show all versions of jalopy Show documentation
A source code formatter/beautifier/pretty printer for the Java programming language.
The newest version!
/*
* Copyright (c) 2001-2002, Marco Hunsicker. All rights reserved.
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*/
package de.hunsicker.jalopy.printer;
import java.io.IOException;
import antlr.collections.AST;
import de.hunsicker.jalopy.storage.ConventionDefaults;
import de.hunsicker.jalopy.storage.ConventionKeys;
/**
* Printer for assignment operators [PLUS_ASSIGN
, MINUS_ASSIGN
,
* STAR_ASSIGN
, DIV_ASSIGN
, MOD_ASSIGN
,
* BAND_ASSIGN
, BOR_ASSIGN
, BXOR_ASSIGN
,
* SL_ASSIGN
, SR_ASSIGN
, BSR_ASSIGN
].
*
* @author Marco Hunsicker
* @version $Revision: 1.5 $
*/
final class AssignmentOperatorPrinter
extends InfixOperatorPrinter
{
//~ Static variables/initializers ----------------------------------------------------
/** Singleton. */
private static final Printer INSTANCE = new AssignmentOperatorPrinter();
//~ Constructors ---------------------------------------------------------------------
/**
* Creates a new AssignmentOperatorPrinter object.
*/
protected AssignmentOperatorPrinter()
{
}
//~ Methods --------------------------------------------------------------------------
/**
* Returns the sole instance of this class.
*
* @return class instance.
*/
public static final Printer getInstance()
{
return INSTANCE;
}
/**
* {@inheritDoc}
*/
public void print(
AST node,
NodeWriter out)
throws IOException
{
super.print(
node,
AbstractPrinter.settings.getBoolean(
ConventionKeys.PADDING_ASSIGNMENT_OPERATORS,
ConventionDefaults.PADDING_ASSIGNMENT_OPERATORS), out);
}
}