1 11 package org.eclipse.jface.text.templates; 12 13 import org.eclipse.core.runtime.Assert; 14 15 23 public final class TemplateBuffer { 24 25 26 private String fString; 27 28 private TemplateVariable[] fVariables; 29 30 36 public TemplateBuffer(String string, TemplateVariable[] variables) { 37 setContent(string, variables); 38 } 39 40 46 public final void setContent(String string, TemplateVariable[] variables) { 47 Assert.isNotNull(string); 48 Assert.isNotNull(variables); 49 50 52 fString= string; 53 fVariables= copy(variables); 54 } 55 56 63 private static TemplateVariable[] copy(TemplateVariable[] array) { 64 if (array != null) { 65 TemplateVariable[] copy= new TemplateVariable[array.length]; 66 System.arraycopy(array, 0, copy, 0, array.length); 67 return copy; 68 } 69 return null; 70 } 71 72 77 public final String getString() { 78 return fString; 79 } 80 81 87 public final TemplateVariable[] getVariables() { 88 return fVariables; 89 } 90 91 } 92 | Popular Tags |