[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: MutableClassInfo?

stale.pedersen@jboss.org do-not-reply at jboss.com
Fri Feb 27 06:33:21 EST 2009


"alesj" wrote : Fine by me.
cool. - another suggestion...
is it ok if i change ModifierInfo to a enum?
atm its just a interface with integers, so methods like:
  | MutableFieldInfo createMutableField/Method/Constructor(ModifierInfo modifier, String type, String name); wont make make any sense since its impossible to send a ModifierInfo object to the method. instead we have to change the signature of the method to something like:MutableFieldInfo createMutableField/Method/Constructor(int modifier, String type, String name);
the enum version of ModifierInfo would look something like:
  | public enum ModifierInfo
  | {
  |    PUBLIC(Modifier.PUBLIC), PRIVATE(Modifier.PRIVATE),....
  |    private final int modifier;
  |    ModifierInfo(int modifier) {this.modifier = modifier; }
  |    public int getValue() { return modifier; }
  |    public boolean isPublic/isStatic/isVolatile/etc;
  | }
- and we need to remove ModifierInfo as a interface on ClassInfo etc, but i feel this is a better solution..?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213681#4213681

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213681



More information about the jboss-dev-forums mailing list