Package com.vaadin.swingkit.core
Class InvocationUtils
java.lang.Object
com.vaadin.swingkit.core.InvocationUtils
Utility class to handle method invocations between a Swing app and a Vaadin
app embedded in a JVaadinPanel.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MethodInvocationCreates aMethodInvocationinstance out of a method and the arguments used in its call.static <E> EDecodes a Base64 String and returns the object encoded in it.static StringEncode a method invocation call or any other object into a Base64 string.static StringEncode a method invocation call and its arguments into a Base64 string.
-
Method Details
-
encode
Encode a method invocation call or any other object into a Base64 string.- Parameters:
methodInvocation- the object to encode, usually aMethodInvocationinstance.- Returns:
- a Base64 string encoding of the object.
- Throws:
IOException- if any problems occur while encoding the object.- See Also:
-
encode
Encode a method invocation call and its arguments into a Base64 string.- Parameters:
method- the method to encode.args- the arguments of the method call.- Returns:
- a Base64 String encoding of the method call.
- Throws:
IOException- if any problems occur while encoding the object.
-
create
Creates aMethodInvocationinstance out of a method and the arguments used in its call.- Parameters:
method- the method in question.args- the arguments used when calling the method.- Returns:
- a
MethodInvocationrepresenting the method call with the passed in arguments.
-
decode
public static <E> E decode(String encodedMethodInvocation) throws IOException, ClassNotFoundException Decodes a Base64 String and returns the object encoded in it. The encoded object can be anything, whether anInvocationResponse, aMethodInvocationor aVaadinSwingEvent.- Type Parameters:
E- the type of the encoded object.- Parameters:
encodedMethodInvocation- the Base64 String to decode.- Returns:
- the object represented by the encoded String.
- Throws:
IOException- if there's any problem decoding the object.ClassNotFoundException- if the class of the object is not present at runtime.
-