// Path: engine/src/main/java/com/impossibl/stencil/engine/ExecutionException.java
// public class ExecutionException extends RuntimeException {
// 
//   private static final long serialVersionUID = 376006343757200461L;
//   
//   ExecutionLocation location;
// 
//   public ExecutionException() {
//   }
// 
//   public ExecutionException(String message, Throwable cause, ExecutionLocation location) {
//     super(location + ": " + message, cause);
//     this.location = location;
//   }
//   
//   public ExecutionException(String message, ExecutionLocation location) {
//     super(location + ": " + message);
//     this.location = location;
//   }
// 
//   public ExecutionException(Throwable cause, ExecutionLocation location) {
//     super(cause);
//     this.location = location;
//   }
// 
//   public ExecutionLocation getLocation() {
//     return location;
//   }
// 
//   public void setLocation(ExecutionLocation location) {
//     this.location = location;
//   }
// 
// }


import java.io.IOException;
import java.io.Writer;
import com.impossibl.stencil.engine.ExecutionException;
package com.impossibl.stencil.api;



/**
 * Block of output commands.  Allows Callable and Preparable
 * objects to retrieve the text of blocks programmatically
 * 
 * @author kdubb
 * @see Callable
 * @see Preparable
 */
public interface Block {
  
  /**
   * Does the block have output available?
   *  
   * @return True if the block has output, false if not
   */
  boolean getHasOutput();
  
  /**
   * Processes the block and writes the resulting text to the given character
   * stream
   * 
   * @param out Character stream to write to
   * @throws IOException
   * @throws ExecutionException 
   */
// Path: engine/src/main/java/com/impossibl/stencil/engine/ExecutionException.java
// public class ExecutionException extends RuntimeException {
// 
//   private static final long serialVersionUID = 376006343757200461L;
//   
//   ExecutionLocation location;
// 
//   public ExecutionException() {
//   }
// 
//   public ExecutionException(String message, Throwable cause, ExecutionLocation location) {
//     super(location + ": " + message, cause);
//     this.location = location;
//   }
//   
//   public ExecutionException(String message, ExecutionLocation location) {
//     super(location + ": " + message);
//     this.location = location;
//   }
// 
//   public ExecutionException(Throwable cause, ExecutionLocation location) {
//     super(cause);
//     this.location = location;
//   }
// 
//   public ExecutionLocation getLocation() {
//     return location;
//   }
// 
//   public void setLocation(ExecutionLocation location) {
//     this.location = location;
//   }
// 
// }


// Path: engine/src/main/java/com/impossibl/stencil/api/Block.java
import java.io.IOException;
import java.io.Writer;
import com.impossibl.stencil.engine.ExecutionException;

package com.impossibl.stencil.api;



/**
 * Block of output commands.  Allows Callable and Preparable
 * objects to retrieve the text of blocks programmatically
 * 
 * @author kdubb
 * @see Callable
 * @see Preparable
 */
public interface Block {
  
  /**
   * Does the block have output available?
   *  
   * @return True if the block has output, false if not
   */
  boolean getHasOutput();
  
  /**
   * Processes the block and writes the resulting text to the given character
   * stream
   * 
   * @param out Character stream to write to
   * @throws IOException
   * @throws ExecutionException 
   */
  void write(Writer out) throws IOException, ExecutionException;