2 * (c) Copyright IBM Corp. 2000, 2001.
5 package net.sourceforge.phpdt.internal.corext.template;
7 import org.eclipse.core.runtime.CoreException;
9 //import org.eclipse.jdt.internal.corext.Assert;
12 * A template buffer is a container for a string and variables.
14 public final class TemplateBuffer {
16 /** The string of the template buffer */
17 private String fString;
18 /** The variable positions of the template buffer */
19 private TemplatePosition[] fVariables;
22 * Creates a template buffer.
24 * @param string the string
25 * @param variables the variable positions
26 * @throws CoreException for illegal variable positions
28 public TemplateBuffer(String string, TemplatePosition[] variables) throws CoreException {
29 setContent(string, variables);
33 * Sets the content of the template buffer.
35 * @param string the string
36 * @param variables the variable positions
37 * @throws CoreException for illegal variable positions
39 public final void setContent(String string, TemplatePosition[] variables) throws CoreException {
40 // Assert.isNotNull(string);
41 // Assert.isNotNull(variables);
43 // XXX assert non-overlapping variable properties
46 fVariables= variables;
50 * Returns the string of the template buffer.
52 public final String getString() {
57 * Returns the variable positions of the template buffer.
59 public final TemplatePosition[] getVariables() {