All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jreversepro.reflect.method.JSwitchBlock Maven / Gradle / Ivy

Go to download

Common utilities is a set of java utilities for managing typical actions when working with enums, files, exceptions, zip/jar files, classes (via Reflection), maps, numbers and so on. Most of the utilities extend functionalities offered by amazing libraries such as: * commons-beanutils (apache) * commons-lang3 (apache) * commons-io (apache) * commons-math3 (apache) * commons-collections4 (apache) * jreversepro (akkumar)

There is a newer version: 1.5.17
Show newest version
/*
 * JSwitchBlock.java
 *
 * Created on September 5, 2002, 4:56 PM
 */

package jreversepro.reflect.method;

import jreversepro.revengine.JBranchEntry;

/**
 * @author [email protected],  Copyright 2002.
 */
public class JSwitchBlock extends JBlockObject {

    /**
     * Contains stringified switch expression
     */
    private final String expr;

    /**
     * Creates a new instance of JSwitchBlock
     *
     * @param _jbe  Branch
     * @param _expr The expression
     */
    public JSwitchBlock(JBranchEntry _jbe, String _expr) {
        /*
      Associated Branch Entry
     */
        expr = _expr;
    }

    /**
     * Outputs any starting code to open the block
     *
     * @return The starting code to open the block
     */
    protected String getEntryCode() {
        return "switch (" + expr + ") {\n";
    }

    /**
     * Outputs any terminating code to close the block
     */
    protected String getExitCode() {
        return "\n" + indent + "}\n";
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy