1
/*******************************************************************************
2
* Copyright (c) 2002, 2008 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
9
* Rational Software - Initial API and implementation
10
*******************************************************************************/
12
package org.eclipse.cdt.internal.core.model;
14
import org.eclipse.cdt.core.model.CModelException;
15
import org.eclipse.cdt.core.model.ICElement;
16
import org.eclipse.cdt.core.model.IVariableDeclaration;
18
public class VariableDeclaration extends SourceManipulation implements IVariableDeclaration {
20
public VariableDeclaration(ICElement parent, String name) {
21
super(parent, name, ICElement.C_VARIABLE_DECLARATION);
24
public VariableDeclaration(ICElement parent, String name, int type) {
25
super(parent, name, type);
28
public String getTypeName() throws CModelException {
29
return getVariableInfo().getTypeName();
32
public void setTypeName(String type) throws CModelException {
33
getVariableInfo().setTypeString(type);
36
public boolean isConst() throws CModelException {
37
return getVariableInfo().isConst();
40
public void setConst(boolean isConst) throws CModelException {
41
getVariableInfo().setConst(isConst);
44
public boolean isVolatile() throws CModelException {
45
return getVariableInfo().isVolatile();
48
public void setVolatile(boolean isVolatile) throws CModelException {
49
getVariableInfo().setVolatile(isVolatile);
52
public boolean isStatic() throws CModelException {
53
return getVariableInfo().isStatic();
56
public void setStatic(boolean isStatic) throws CModelException {
57
getVariableInfo().setStatic(isStatic);
60
public VariableInfo getVariableInfo() throws CModelException{
61
return (VariableInfo) getElementInfo();
65
protected CElementInfo createElementInfo () {
66
return new VariableInfo(this);