Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 21.1

...

Java Data TypeBridge Base Type
boolean, java.lang.BooleanBoolean
byte, java.lang.ByteInteger
short, java.lang.ShortInteger
int, java.lang.IntegerInteger
long, java.lang.LongInteger
float, java.lang.FloatFloat
double, java.lang.DoubleFloat
char, java.lang.CharacterString
java.lang.StringString
java.util.Date and subclassesDateTime
java.util.GregorianCalendar and subclassesDateTime
java.io.InputStream and subclassesBlob
byte[], java.lang.Byte[]Blob
java.util.Collection and implementationsArray
Arrays except byte[] and java.lang.Byte[]Array
java.util.Map and implementations Array of a specialized class with stereotype <<MapEntry>> having two attributes of Bridge base type

...

TopicHint
Checked exceptions in the default constructorThe Bridge Java wrapper cannot handle checked exceptions in the default constructor of a Java class. If you need this nevertheless, you need to wrap the checked exception with an unchecked one.
Data manipulation on the Java objectIf you want to manipulate data of a Java object, there is no need to transfer it to xUML and back (if not necessary). Leave the object management to Java and store the created objects in a thread-save concurrent hashmap. Then, simply transfer only an object id between the xUML model and the Java implementation.
Catching exceptions after adapter call

If you want to catch exceptions that occurred during the adapter call in your xUML model, you need to throw these exceptions in your Java code using one of the following:

Code Block
languagejava
throw new BridgeException("your error message", "your error code", "your error domain");
throw new BridgeException("your error message", "your error code");
throw new BridgeException("your error message");

In order to use BridgeException, you need to import class ch.e2e.bridge.server.BridgeException from addon.jar to your Java implementation. You can find this JAR in your Magic Draw installation folder at /plugins/ch.e2e.builder.plugin.magicdraw/lib/system/addon.jar.

Multiexcerpt include
SpaceWithExcerptINTERNAL
MultiExcerptNamejavaThrowException
PageWithExcerptINTERNAL:_examples_BRIDGE