![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.jenesis4java.Codeable Maven / Gradle / Ivy
package net.sourceforge.jenesis4java;
/*
* #%L
* Jenesis 4 Java Code Generator
* %%
* Copyright (C) 2000 - 2015 jenesis4java
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
/**
* Copyright (C) 2008, 2010 Richard van Nieuwenhoven - ritchie [at] gmx [dot] at
* Copyright (C) 2000, 2001 Paul Cody Johnston - [email protected]
* This file is part of Jenesis4java. Jenesis4java is free software: you can
* redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
* Jenesis4java is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
* You should have received a copy of the GNU Lesser General Public License
* along with Jenesis4java. If not, see .
*/
/**
* {@code Codeable} is a core interface which nearly all other interfaces
* extend. Objects that implement this interface are expected to know how to
* render themselves as source code to a {@code CodeWriter}. Any
* {@code Codeable} is be commentable as well.
*/
public interface Codeable {
/**
* @return this casted to the parameter class.
*/
T cast(Class clazz);
/**
* Gets the comment for this {@code Codeable} object.
*/
Comment getComment();
boolean isBlockWithAbruptCompletion();
/**
* Sets the comment to the given type and text.
*/
Codeable setComment(int type, String text);
/**
* Renders the codeable object to the given writer and returns it.
*/
CodeWriter toCode(CodeWriter out);
/**
* walk through the code tree and allow every element to be exchanged.
*/
void visit(ReplacingVisitor visitor);
/**
* Returns the virtual machine to which this {@code Codeable} object
* belongs.
*/
VirtualMachine vm();
Codeable applyStyle(Style style);
boolean isActive(Style style);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy