diff options
author | Michael Bien <[email protected]> | 2009-08-08 21:46:55 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2009-08-08 21:46:55 +0200 |
commit | 889b9574958b04988ab3acbabab109745fbc379a (patch) | |
tree | 5f3485268de0f59f113c9d524561fc49b50ad75f /src/java/com/sun/gluegen/ConstantDefinition.java | |
parent | a07c223b8dbde8f81886b7b2bf602e26ab9531b3 (diff) | |
parent | 5f8e46324f245c99080d2c340cd4fb2ec9c4fa8d (diff) |
Merge branch 'master' of ssh://[email protected]/gluegen~gluegen-git
Diffstat (limited to 'src/java/com/sun/gluegen/ConstantDefinition.java')
-rw-r--r-- | src/java/com/sun/gluegen/ConstantDefinition.java | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/java/com/sun/gluegen/ConstantDefinition.java b/src/java/com/sun/gluegen/ConstantDefinition.java index e06903b..44ce8e0 100644 --- a/src/java/com/sun/gluegen/ConstantDefinition.java +++ b/src/java/com/sun/gluegen/ConstantDefinition.java @@ -38,17 +38,24 @@ import java.util.*; /** Represents the definition of a constant which was provided either via a #define statement or through an enum definition. */ public class ConstantDefinition { + private String origName; + private HashSet aliasedNames; private String name; private String value; + private boolean isEnum; private String enumName; private Set/*<String>*/ aliases; public ConstantDefinition(String name, String value, + boolean isEnum, String enumName) { + this.origName = name; this.name = name; this.value = value; + this.isEnum = isEnum; this.enumName = enumName; + this.aliasedNames=new HashSet(); } public boolean equals(ConstantDefinition other) { @@ -72,12 +79,36 @@ public class ConstantDefinition { return name.hashCode(); } - public String getName() { return name; } + /** Supports renaming in Java binding. */ + public void rename(String name) { + if(null!=name) { + this.name = name; + aliasedNames.add(origName); + } + } + + public void addAliasedName(String name) { + aliasedNames.add(name); + } + public Collection getAliasedNames() { + return aliasedNames; + } + + public String getOrigName() { + return origName; + } + + public String getName() { + return name; + } + public String getValue() { return value; } /** Returns null if this definition was not part of an enumeration, or if the enum was anonymous. */ public String getEnumName() { return enumName; } + public boolean isEnum() { return isEnum; } + public Set/*<String>*/ getAliases() { return aliases; } |