1 18 package org.apache.geronimo.interop.generator; 19 20 import java.lang.reflect.Modifier ; 21 22 public class JEntity { 23 private String name; 24 private int modifiers; 25 private JEntity parent; 26 27 public JEntity(String name) { 28 this(name, Modifier.PUBLIC); 29 } 30 31 public JEntity(String name, int modifiers) { 32 this.name = name; 33 this.modifiers = modifiers; 34 } 35 36 public JEntity getParent() { 37 return parent; 38 } 39 40 public void setParent(JEntity parent) { 41 this.parent = parent; 42 } 43 44 public String getName() { 45 return name; 46 } 47 48 public void setName(String val) { 49 name = val; 50 } 51 52 56 protected void adjustModifier(int modifier, boolean value) { 57 if (value) { 58 modifiers = (modifiers | modifier); 59 } else { 60 if ((modifiers & modifier) == modifier) { 61 modifiers = (modifiers ^ modifier); 62 } 63 } 64 } 65 66 public void setModifier( int modifier ) 67 { 68 adjustModifier( modifier, true ); 69 } 70 71 public void unsetModifier( int modifier ) 72 { 73 adjustModifier( modifier, false ); 74 } 75 76 81 public void setModifiers(int modifiers) { 82 this.modifiers = modifiers; 83 } 84 85 public int getModifiers() { 86 return modifiers; 87 } 88 } 89 | Popular Tags |