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

net.sf.mmm.code.api.comment.CodeComment Maven / Gradle / Ivy

There is a newer version: 1.0.0-beta7
Show newest version
/* 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