01: /*******************************************************************************
02: * Copyright (c) 2005 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.pde.internal.core.product;
11:
12: import java.io.PrintWriter;
13:
14: import org.eclipse.pde.internal.core.iproduct.IProductFeature;
15: import org.eclipse.pde.internal.core.iproduct.IProductModel;
16: import org.w3c.dom.Element;
17: import org.w3c.dom.Node;
18:
19: public class ProductFeature extends ProductObject implements
20: IProductFeature {
21:
22: private static final long serialVersionUID = 1L;
23: private String fId;
24: private String fVersion;
25:
26: public ProductFeature(IProductModel model) {
27: super (model);
28: }
29:
30: public void parse(Node node) {
31: if (node.getNodeType() == Node.ELEMENT_NODE) {
32: Element element = (Element) node;
33: fId = element.getAttribute("id"); //$NON-NLS-1$
34: fVersion = element.getAttribute("version"); //$NON-NLS-1$
35: }
36: }
37:
38: public void write(String indent, PrintWriter writer) {
39: writer
40: .println(indent
41: + "<feature id=\"" + fId + "\" version=\"" + fVersion + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
42: }
43:
44: public String getId() {
45: return fId;
46: }
47:
48: public void setId(String id) {
49: fId = id;
50: }
51:
52: public String getVersion() {
53: return fVersion;
54: }
55:
56: public void setVersion(String version) {
57: fVersion = version;
58: }
59:
60: }
|