@Override public String toString() { return super.toString() + " (" + ClassUtils.getSimpleName(type) + ")"; }
private void assertStreamOk() { if (!streamOk) { throw new IllegalArgumentException("TCP protocol " + ClassUtils.getSimpleName(protocol.getClass()) + " does not support streaming output"); } }
/** * @param string */ @Override public void setName(String string) { if (string == null) { string = ClassUtils.getSimpleName(this.getClass()); } logger.debug("Setting transformer name to: " + string); name = string; }
public static Message transformUnexpectedType(Class<?> class1, Class<?> returnClass) { return factory.createMessage(BUNDLE_PATH, 53, ClassUtils.getSimpleName(class1), ClassUtils.getSimpleName(returnClass)); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(60); sb.append(ClassUtils.getSimpleName(this.getClass())); sb.append("{this=").append(Integer.toHexString(System.identityHashCode(this))); sb.append(", createDispatcherPerRequest=").append(this.isCreateDispatcherPerRequest()); sb.append('}'); return sb.toString(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(80); sb.append(ClassUtils.getSimpleName(this.getClass())); sb.append("{this=").append(Integer.toHexString(System.identityHashCode(this))); sb.append(", receiverKey=").append(receiverKey); sb.append(", endpoint=").append(endpoint.getEndpointURI()); sb.append('}'); return sb.toString(); }
@Override public String toString() { return String.format("%s{%s}", ClassUtils.getSimpleName(this.getClass()), getName()); } }
@Override public String toString() { final StringBuilder sb = new StringBuilder(60); sb.append(ClassUtils.getSimpleName(this.getClass())); sb.append("{this=").append(Integer.toHexString(System.identityHashCode(this))); sb.append(", createRequesterPerRequest=").append(this.isCreateRequesterPerRequest()); sb.append('}'); return sb.toString(); }
@Override public String toString() { return String.format("%s{%s}", ClassUtils.getSimpleName(this.getClass()), getName()); }
@Override public String toString() { return String.format("%s{%s}", ClassUtils.getSimpleName(this.getClass()), getName()); }
@Override public String toString() { StringBuilder sb = new StringBuilder(80); sb.append(ClassUtils.getSimpleName(this.getClass())); sb.append("{this=").append(Integer.toHexString(System.identityHashCode(this))); sb.append(", name='").append(name).append('\''); sb.append(", ignoreBadInput=").append(ignoreBadInput); sb.append(", returnClass=").append(returnType); sb.append(", sourceTypes=").append(sourceTypes); sb.append('}'); return sb.toString(); }
@Override public String toString() { return String.format("%s{%s}", ClassUtils.getSimpleName(this.getClass()), getName()); }
public static Message messageIsOfType(Class<?> type) { return factory.createMessage(BUNDLE_PATH, 18, ClassUtils.getSimpleName(type)); }
private static void processSingleNoRetry(Object target, Method method, Class<?> exception, Class<?> iface) throws LifecycleException { if (! iface.isAssignableFrom(target.getClass())) { throw new IllegalArgumentException(ClassUtils.getSimpleName(target.getClass()) + " is not an " + ClassUtils.getSimpleName(iface)); } try { method.invoke(target); } catch (IllegalAccessException e) { throw (IllegalArgumentException) new IllegalArgumentException("Unsupported interface: " + iface).initCause(e); } catch (InvocationTargetException e) { throw (IllegalArgumentException) new IllegalArgumentException("Unsupported interface: " + iface).initCause(e); } }
@Override public String toString() { final StringBuilder sb = new StringBuilder(80); sb.append(ClassUtils.getSimpleName(this.getClass())); sb.append("{this=").append(Integer.toHexString(System.identityHashCode(this))); sb.append(", endpoint=").append(endpoint.getEndpointURI()); sb.append(", disposed=").append(getLifecycleState().isDisposed()); sb.append('}'); return sb.toString(); }
public static String generateTransformerName(Class<? extends Transformer> transformerClass, DataType returnType) { String transformerName = ClassUtils.getSimpleName(transformerClass); int i = transformerName.indexOf("To"); if (i > 0 && returnType != null) { String target = ClassUtils.getSimpleName(returnType.getType()); if (target.equals("byte[]")) { target = "byteArray"; } transformerName = transformerName.substring(0, i + 2) + StringUtils.capitalize(target); } return transformerName; } }
/** * Like {@link #identityToString(Object)} but without the object's full package * name. * * @param obj the object for which the identity description is to be generated * @return the object's identity description in the form of * "ClassName@IdentityCode" or "null" if the argument was null. */ public static String identityToShortString(Object obj) { if (obj == null) { return "null"; } else { return new StringBuilder(40).append( ClassUtils.getSimpleName(obj.getClass())) .append('@') .append(Integer.toHexString(System.identityHashCode(obj)) ).toString(); } }
/** * Check if the return class is supported by this transformer */ protected Object checkReturnClass(Object object, MuleEvent event) throws TransformerMessagingException { //Null is a valid return type if(object==null || object instanceof NullPayload && isAllowNullReturn()) { return object; } if (returnType != null) { DataType<?> dt = DataTypeFactory.create(object.getClass()); if (!returnType.isCompatibleWith(dt)) { throw new TransformerMessagingException( CoreMessages.transformUnexpectedType(dt, returnType), event, this); } } if (logger.isDebugEnabled()) { logger.debug("The transformed object is of expected type. Type is: " + ClassUtils.getSimpleName(object.getClass())); } return object; }
/** * Checks whether a given value is a valid output for a transformer. * * @param transformer the transformer used to validate * @param value the output value * @throws TransformerException if the out[ut value is of a unexpected type. */ public static void checkTransformerReturnClass(Transformer transformer, Object value) throws TransformerException { if (value == null || value instanceof NullPayload && (transformer instanceof AbstractTransformer &&((AbstractTransformer) transformer).isAllowNullReturn())) { return; } if (transformer.getReturnDataType() != null) { DataType<?> dt = DataTypeFactory.create(value.getClass()); if (!transformer.getReturnDataType().isCompatibleWith(dt)) { throw new TransformerException( CoreMessages.transformUnexpectedType(dt, transformer.getReturnDataType()), transformer); } } if (LOGGER.isDebugEnabled()) { LOGGER.debug("The transformed value is of expected type. Type is: " + ClassUtils.getSimpleName(value.getClass())); } }
ClassUtils.getSimpleName(getClass())), this);