blob: ce19e2ff94c63f92c1d1265d4af0b7025bb85d9e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
/*******************************************************************************
* Copyright (c) 2000, 2011 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IField;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
public class Field extends VariableDeclaration implements IField {
public Field(ICElement parent, String name) {
super(parent, name, ICElement.C_FIELD);
}
@Override
public boolean isMutable() throws CModelException {
return getFieldInfo().isMutable();
}
public void setMutable(boolean mutable) throws CModelException {
getFieldInfo().setMutable(mutable);
}
@Override
public String getTypeName() throws CModelException {
return getFieldInfo().getTypeName();
}
@Override
public void setTypeName(String type) throws CModelException {
getFieldInfo().setTypeName(type);
}
@Override
public boolean isConst() throws CModelException {
return getFieldInfo().isConst();
}
@Override
public void setConst(boolean isConst) throws CModelException {
getFieldInfo().setConst(isConst);
}
@Override
public boolean isVolatile() throws CModelException {
return getFieldInfo().isVolatile();
}
@Override
public void setVolatile(boolean isVolatile) throws CModelException {
getFieldInfo().setVolatile(isVolatile);
}
@Override
public boolean isStatic() throws CModelException {
return getFieldInfo().isStatic();
}
@Override
public void setStatic(boolean isStatic) throws CModelException {
getFieldInfo().setStatic(isStatic);
}
@Override
public ASTAccessVisibility getVisibility() throws CModelException {
return getFieldInfo().getVisibility();
}
public void setVisibility(ASTAccessVisibility visibility) throws CModelException {
getFieldInfo().setVisibility(visibility);
}
public FieldInfo getFieldInfo() throws CModelException {
return (FieldInfo) getElementInfo();
}
@Override
protected CElementInfo createElementInfo() {
return new FieldInfo(this);
}
}
|