net.sf.mmm.code.api.comment.CodeComment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mmm-code-api Show documentation
Show all versions of mmm-code-api Show documentation
The API to parse, analyze, transform and generate code.
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.code.api.comment;
import java.util.Iterator;
import java.util.List;
import net.sf.mmm.code.api.expression.CodeVariable;
import net.sf.mmm.code.api.statement.CodeStatement;
/**
* {@link CodeStatement} for a comment.
*
* @author hohwille
* @since 1.0.0
*/
public abstract interface CodeComment extends CodeStatement, Iterable {
@Override
default CodeVariable getVariable(String name) {
return null;
}
@Override
default Iterator iterator() {
return getCommentLines().iterator();
}
/**
* @return the {@link List} of comment lines. Will always have the {@link List#size() size} {@code 1} in
* case of {@link CodeSingleLineComment}. Each contained {@link String} will be the pure comment
* without leading comment prefix ("// ", "/* ", etc.).
*/
Iterable getCommentLines();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy