ProductFeature.java :  » IDE-Eclipse » Eclipse-plug-in-development » org » eclipse » pde » internal » core » product » Java Open Source

Java Open Source » IDE Eclipse » Eclipse plug in development 
Eclipse plug in development » org » eclipse » pde » internal » core » product » ProductFeature.java
/*******************************************************************************
 * Copyright (c) 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.pde.internal.core.product;

import java.io.PrintWriter;

import org.eclipse.pde.internal.core.iproduct.IProductFeature;
import org.eclipse.pde.internal.core.iproduct.IProductModel;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class ProductFeature extends ProductObject implements IProductFeature {

  private static final long serialVersionUID = 1L;
  private String fId;
  private String fVersion;

  public ProductFeature(IProductModel model) {
    super(model);
  }

  public void parse(Node node) {
    if (node.getNodeType() == Node.ELEMENT_NODE) {
      Element element = (Element)node;
      fId = element.getAttribute("id"); //$NON-NLS-1$
      fVersion = element.getAttribute("version"); //$NON-NLS-1$
    }
  }

  public void write(String indent, PrintWriter writer) {
    writer.println(indent + "<feature id=\"" + fId + "\" version=\"" + fVersion + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  }

  public String getId() {
    return fId;
  }

  public void setId(String id) {
    fId = id;
  }

  public String getVersion() {
    return fVersion;
  }

  public void setVersion(String version) {
    fVersion = version;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.