KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > product > ProductFeature


1 /*******************************************************************************
2  * Copyright (c) 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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