import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
-import java.util.Vector;
+import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
//the suers custom file - if that file should be changed,
//then all entries in this variable should be removed from
//the word list, reread from the file and then reinserted.
- private static Vector userdefsyntaxdata;
+ private static ArrayList userdefsyntaxdata;
- private static Vector syntaxdata;
+ private static ArrayList syntaxdata;
public PHPSyntaxRdr() {
- syntaxdata = new Vector();
+ // see getSyntaxData()
+ syntaxdata = null;
store = PHPeclipsePlugin.getDefault().getPreferenceStore();
}
//ignore as it is not a valid phpsyntax tag
} else {
if (Keyword != null) {
- syntaxdata.addElement(
+ syntaxdata.add(
new PHPKeyword(Keyword, usage, Tokenval));
} else if (Type != null) {
- syntaxdata.addElement(new PHPType(Type, usage));
+ syntaxdata.add(new PHPType(Type, usage));
} else if (Function != null) {
- syntaxdata.addElement(
+ syntaxdata.add(
new PHPFunction(Function, usage, description));
} else if (Constant != null) {
- syntaxdata.addElement(new PHPConstant(Constant, usage));
+ syntaxdata.add(new PHPConstant(Constant, usage));
}
}
}
}
}
- public static Vector getsyntaxdata() {
- return (Vector) syntaxdata.clone();
+ public static ArrayList getSyntaxData() {
+ if (syntaxdata==null) {
+ syntaxdata = new ArrayList();
+ readInSyntax();
+ }
+ return syntaxdata;
}
public static void replaceUserDefFile() {
}
}
- public static Vector getUserDefinitions() {
- return (Vector) userdefsyntaxdata.clone();
+ public static ArrayList getUserSyntaxData() {
+ return userdefsyntaxdata;
}
private static File getSyntaxFile() {
private static void throwReadException(Throwable t) throws CoreException {
PHPeclipsePlugin.log(t);
// IStatus status= new JavaUIStatus(JavaStatusConstants.TEMPLATE_IO_EXCEPTION,
- // TemplateMessages.getString("TemplateSet.error.read"), t); //$NON-NLS-1$
+ // ObfuscatorMessages.getString("TemplateSet.error.read"), t); //$NON-NLS-1$
// throw new JavaUIException(status);
}
private static void throwWriteException(Throwable t) throws CoreException {
PHPeclipsePlugin.log(t);
// IStatus status= new JavaUIStatus(JavaStatusConstants.TEMPLATE_IO_EXCEPTION,
- // TemplateMessages.getString("TemplateSet.error.write"), t); //$NON-NLS-1$
+ // ObfuscatorMessages.getString("TemplateSet.error.write"), t); //$NON-NLS-1$
// throw new JavaUIException(status);
}