/** * helper method for extracting the portlet methods from the portlet class. * * @param cls * @param name * @param md * @return */ private AnnotatedMethod getMethod(Class<?> cls, String name, MethodDescription md) { AnnotatedMethod am = null; try { Method meth = cls.getMethod(name, md.getArgTypes()); am = new AnnotatedMethod(cls, null, meth, md); } catch (Exception e) { if (isDebug) { StringBuilder txt = new StringBuilder(); txt.append("Could not retrieve method from portlet class."); txt.append(" Method name: ").append(name); txt.append(", Class: ").append(cls.getCanonicalName()); txt.append(", Argument types: ").append(md.getArgTypes()); LOG.debug(txt.toString()); } } return am; }
String sep = " "; for (MethodDescription desc : descs) { if (desc.isMethodMatched(meth)) { matchingDesc = desc; break; } else { errtxt.append(sep).append(desc.getExpectedSignature(true)); sep = "\n "; txt.append(", method: ").append(meth.getName()); if (matchingDesc != null) { txt.append(", recognized type: ").append(matchingDesc.getType()); txt.append(", signature variant: ").append(matchingDesc.getVariant()); } else { txt.append(", No match found. Error string:\n");
/** * Returns the annotated method for a given identifier. * * It's a programming error if this method is used when multiple methods could be expected. * * @param mi The method identifier * @return The annotated method, or <code>null</code> if none was found. */ public AnnotatedMethod getMethod(MethodIdentifier mi) { AnnotatedMethod pm = null; List<AnnotatedMethod> list = methods.get(mi); if (list != null) { assert list.size() == 1; assert !list.get(0).getDescription().isAllowMultiple(); pm = list.get(0); } if (isTrace) { StringBuilder txt = new StringBuilder(128); txt.append("Retrieved annotated method for: ").append(mi.toString()); txt.append(", Method: ").append(pm == null ? "null" : pm.toString()); LOG.trace(txt.toString()); } return pm; }
if (meth.getDescription().getVariant() == SignatureVariant.VOID_HEADERREQ_HEADERRESP) { args = new Object[] { req, resp }; if (meth.getDescription().getVariant() == SignatureVariant.STRING_VOID) { if (result != null) { assert result instanceof String;
/** * shows all info about this description */ public String toString() { StringBuilder txt = new StringBuilder(128); txt.append(getExpectedSignature(false)); txt.append("/ type=").append(type); txt.append(", variant=").append(variant); txt.append(", checkExceptions=").append(checkExceptions); txt.append(", allowMultiple=").append(allowMultiple); return txt.toString(); }
String dispatchId = ""; MethodType type = desc.getType(); if (anno instanceof RenderMethod) { RenderMethod tcc = (RenderMethod) anno;
if (meth.getDescription().getVariant() == SignatureVariant.VOID_RENDERREQ_RENDERRESP) { args = new Object[] { req, resp }; if (meth.getDescription().getVariant() == SignatureVariant.STRING_VOID) { if (result != null) { assert result instanceof String;
if (meth.getDescription().getVariant() == SignatureVariant.VOID_RESOURCEREQ_RESOURCERESP) { args = new Object[] { req, resp }; if (meth.getDescription().getVariant() == SignatureVariant.STRING_VOID) { if (result != null) { assert result instanceof String;
if (!am.getDescription().isAllowMultiple()) { StringBuilder txt = new StringBuilder(128); txt.append("Duplicate method specification. Method identifier: ");