/**Adds a Method Descriptor. Methods <b>must</b> be added in the same order as they appear in the IDL. * * <p> Please note that overloaded methods are not allowed. * @param methodDescriptor * @throws IllegalArgumentException if a method by the same name already exists. */ public void addMethodDescriptor(JILocalMethodDescriptor methodDescriptor) { if (nameVsMethodInfo.containsKey(methodDescriptor.getMethodName())) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_CALLBACK_OVERLOADS_NOTALLOWED)); } methodDescriptor.setMethodNum(nextNum); nextNum++; opnumVsMethodInfo.put(new Integer(methodDescriptor.getMethodNum()),methodDescriptor); if (dispInterface) { if (methodDescriptor.getMethodDispID() == -1) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_METHODDESC_DISPID_MISSING)); } dispIdVsMethodInfo.put(new Integer(methodDescriptor.getMethodDispID()),methodDescriptor); } nameVsMethodInfo.put(methodDescriptor.getMethodName(),methodDescriptor); }
/**Adds a Method Descriptor. Methods <b>must</b> be added in the same order as they appear in the IDL. * * <p> Please note that overloaded methods are not allowed. * @param methodDescriptor * @throws IllegalArgumentException if a method by the same name already exists. */ public void addMethodDescriptor(JILocalMethodDescriptor methodDescriptor) { if (nameVsMethodInfo.containsKey(methodDescriptor.getMethodName())) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_CALLBACK_OVERLOADS_NOTALLOWED)); } methodDescriptor.setMethodNum(nextNum); nextNum++; opnumVsMethodInfo.put(new Integer(methodDescriptor.getMethodNum()),methodDescriptor); if (dispInterface) { if (methodDescriptor.getMethodDispID() == -1) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_METHODDESC_DISPID_MISSING)); } dispIdVsMethodInfo.put(new Integer(methodDescriptor.getMethodDispID()),methodDescriptor); } nameVsMethodInfo.put(methodDescriptor.getMethodName(),methodDescriptor); }
/** * Adds a Method Descriptor. Methods <b>must</b> be added in the same order * as they appear in the IDL. * <p> * Please note that overloaded methods are not allowed. * * @param methodDescriptor * @throws IllegalArgumentException * if a method by the same name already exists. */ public void addMethodDescriptor ( final JILocalMethodDescriptor methodDescriptor ) { if ( this.nameVsMethodInfo.containsKey ( methodDescriptor.getMethodName () ) ) { throw new IllegalArgumentException ( JISystem.getLocalizedMessage ( JIErrorCodes.JI_CALLBACK_OVERLOADS_NOTALLOWED ) ); } methodDescriptor.setMethodNum ( this.nextNum ); this.nextNum++; this.opnumVsMethodInfo.put ( new Integer ( methodDescriptor.getMethodNum () ), methodDescriptor ); if ( this.dispInterface ) { if ( methodDescriptor.getMethodDispID () == -1 ) { throw new IllegalArgumentException ( JISystem.getLocalizedMessage ( JIErrorCodes.JI_METHODDESC_DISPID_MISSING ) ); } this.dispIdVsMethodInfo.put ( new Integer ( methodDescriptor.getMethodDispID () ), methodDescriptor ); } this.nameVsMethodInfo.put ( methodDescriptor.getMethodName (), methodDescriptor ); }