01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.cheatsheets.data;
11:
12: import java.net.MalformedURLException;
13: import java.net.URL;
14:
15: /**
16: * The input to the parser which can be the URL of a file
17: * or a string of XML
18: */
19:
20: public class ParserInput {
21: private URL url;
22: private String xml;
23: private String pluginId;
24:
25: public ParserInput() {
26: url = null;
27: xml = null;
28: }
29:
30: public ParserInput(String xml, String basePath) {
31: this .xml = xml;
32: this .url = null;
33: if (basePath != null) {
34: try {
35: this .url = new URL(basePath);
36: } catch (MalformedURLException e) {
37: // leave the url null
38: }
39: }
40: }
41:
42: public ParserInput(URL url, String pluginId) {
43: this .url = url;
44: this .xml = null;
45: this .pluginId = pluginId;
46: }
47:
48: public URL getUrl() {
49: return url;
50: }
51:
52: public String getXml() {
53: return xml;
54: }
55:
56: public String getPluginId() {
57: return pluginId;
58: }
59:
60: }
|