public GrReflectedMethodImpl(GrMethod baseMethod, GrParameter[] parameters, int optionalParams, PsiClassType categoryType) { super(baseMethod.getManager(), baseMethod.getLanguage(), baseMethod.getName(), new GrLightParameterListBuilder(baseMethod.getManager(), baseMethod.getLanguage()), new GrLightModifierList(baseMethod), new LightReferenceListBuilder(baseMethod.getManager(), baseMethod.getLanguage(), null), new LightTypeParameterListBuilder(baseMethod.getManager(), baseMethod.getLanguage()) ); initParameterList(parameters, optionalParams, categoryType); initTypeParameterList(baseMethod); initModifiers(baseMethod, categoryType != null); initThrowsList(baseMethod); setContainingClass(baseMethod.getContainingClass()); setMethodReturnType(baseMethod.getReturnType()); setConstructor(baseMethod.isConstructor()); myBaseMethod = baseMethod; }
public GrLightMethodBuilder(PsiManager manager, String name) { super(manager, GroovyLanguage.INSTANCE); myName = name; myModifierList = new GrLightModifierList(this); myParameterList = new GrLightParameterListBuilder(manager, GroovyLanguage.INSTANCE); myTypeParameterList = new LightTypeParameterListBuilder(manager, GroovyLanguage.INSTANCE); myThrowsList = new LightReferenceListBuilder(manager, GroovyLanguage.INSTANCE, PsiReferenceList.Role.THROWS_LIST); }
public GrLightMethodBuilder(PsiManager manager, String name) { super(manager, GroovyFileType.GROOVY_LANGUAGE); myName = name; myParameterList = new GrLightParameterListBuilder(manager, GroovyFileType.GROOVY_LANGUAGE); myModifierList = new GrLightModifierList(this); myConstructor = false; myThrowsList = new LightReferenceListBuilder(manager, GroovyFileType.GROOVY_LANGUAGE, PsiReferenceList.Role.THROWS_LIST); }
@NotNull @Override public PsiReferenceList getThrowsList() { LightReferenceListBuilder builder = new LightReferenceListBuilder(getManager(), PsiReferenceList.Role.THROWS_LIST); builder.addReference(JavaClassNames.JAVA_LANG_THROWABLE); return builder; }
@Override @NotNull public LightReferenceListBuilder getThrowsList() { return myThrowsList; }
public GrLightMethodBuilder addException(PsiClassType type) { ((LightReferenceListBuilder)myThrowsList).addReference(type); return this; }
@NotNull @Override public PsiReferenceList getExtendsList() { return new LightReferenceListBuilder(getManager(), PsiReferenceList.Role.EXTENDS_LIST); }