1 26 27 package org.objectweb.openccm.generator.java.ast.lib; 28 29 import org.objectweb.openccm.generator.java.ast.api.MethodObject; 30 import org.objectweb.openccm.generator.java.ast.api.AbstractObject; 31 import org.objectweb.openccm.generator.java.ast.api.StaticObject; 32 import org.objectweb.openccm.generator.java.ast.api.AttributeObject; 33 import org.objectweb.openccm.generator.java.ast.api.MethodContent; 34 import java.util.ArrayList ; 35 36 41 42 public class MethodObjectImpl 43 extends ObjectBaseImpl 44 implements MethodObject 45 { 46 52 53 private AbstractObject abstract_delegate_; 54 55 56 private StaticObject static_delegate_; 57 58 59 private AttributeObject return_type_; 60 61 62 private ArrayList parameters_; 63 64 65 private ArrayList exceptions_; 66 67 68 private MethodContent impl_; 69 70 76 77 public 78 MethodObjectImpl() 79 { 80 super(); 82 abstract_delegate_ = new AbstractObjectImpl(); 83 static_delegate_ = new StaticObjectImpl(); 84 return_type_ = null; 85 parameters_ = new ArrayList (); 86 exceptions_ = new ArrayList (); 87 impl_ = new MethodContentImpl(); 88 } 89 90 96 102 108 113 public void 114 setAbstract(boolean b) 115 { 116 abstract_delegate_.setAbstract(b); 117 } 118 119 124 public boolean 125 isAbstract() 126 { 127 return abstract_delegate_.isAbstract(); 128 } 129 130 136 141 public void 142 setStatic(boolean b) 143 { 144 static_delegate_.setStatic(b); 145 } 146 147 152 public boolean 153 isStatic() 154 { 155 return static_delegate_.isStatic(); 156 } 157 158 164 169 public void 170 setReturnType(String type) 171 { 172 return_type_ = new AttributeObjectImpl(); 173 return_type_.setType(type); 174 } 175 176 181 public AttributeObject 182 getReturnType() 183 { 184 return return_type_; 185 } 186 187 192 public void 193 addParameter(AttributeObject param) 194 { 195 parameters_.add(param); 196 } 197 198 203 public ArrayList 204 getParameters() 205 { 206 return parameters_; 207 } 208 209 214 public MethodContent 215 getImpl() 216 { 217 return impl_; 218 } 219 220 225 public void 226 addException(String ex) 227 { 228 exceptions_.add(ex); 229 } 230 231 236 public ArrayList 237 getExceptions() 238 { 239 return exceptions_; 240 } 241 } 242 | Popular Tags |