Today I had to reuse my code snippet from the JAXB and CDATA blog post to integrate it into a Jersey web application. The application produces some content which could contain some „strings“ which must be wrapped by a CDATA section. To realize this I implemented a javax.ws.rs.ext.MessageBodyReader and javax.ws.rs.ext.MessageBodyWriter by extending from the class com.sun.jersey.core.provider.jaxb.AbstractJAXBElementProvider. This implementation is registered at the Jersey Application by returning the class object in the com.bosch.im.jaxrs.ImApplication.getClasses() implementation.
(mehr …)
When validating the content of an HTML text input field it is often ineffective to trigger the remote validation for each character change. Sometimes you can use a buffer, so validation is only done after a fix time interval. For other scenarios it is a good solution to create a validator which works completely on the client side, using JavaScript. This blog post provides a quick overview and a simple tutorial for creating a JavaScript parser. (mehr …)
I even answered a guy in the Hibernate community how to map a datatype like java.net.URL and than I asked myself why some people have problems to provide them in a JPA annotated bean. It is very easy and you don’t have to implement any special JPA provider dependent interface. The solution is so easy. Break your bean down into their properties and annotate this properties as you normally do. And than – no magic – do your mapping in your getter and setter operation. Through this, you hide the information that your bean does not hold a value of your complex type. You break the type down in a setter and recreate it in the getter operation. For performance you can hold a field of your complex type and annotate it with the javax.persistence.Transient annotation.
I’m currently developing a Java source generator based on UML and UML Profiles. In my profile I created a tagged value with the name „type“ and metaclass „Attribute“. After applying the stereotype to an attribute I had a lot of errors during the code generation. The error message was: „Couldn’t find operation ‚getTypeName(Common::TaggedValueType)‘ for uml::Class.Occured in: EXPAND expand:: … ::Root FOR model“ for „«getTypeName(att.type)»“. I debugged the interpreter and it seems that tagged values can override default visible attributes of the element. There should realy be a warning in the Xpand documentation.
Fixed bugs in import conflict handling and context menu integration. The context menu entry is now also visible in the context menu of the editor.
I created a new release of CQTP. It contains a bugfix for an bug in the import grouping. The fully qualified type detector collects more possible import candidates.
This release contains a bugfix to filter also imports from the same package and the root package. The Xpand integration provides a configurable sorting functionality for imports now.
Heute gab es ein paar Bug-Fixes. Außerdem lässt sich das Plugin jetzt auch außerhalb der Eclipse Runtime nutzen. Aufgund der Änderungen kann ich jetzt ein zuätzliches Plugin für Xpand anbieten. Xpand ist ein Generator-Framework zur Erstellung eigener Code Generatoren.
Xpand basierte Generatoren nutzen oft keine import-Statements, da sie nur sehr komplex erzeugt werden können und sich Importkonflikte nur durch Modeling by Convention vermeiden lassen. Es wird daher oftmals gegen vollqualifizierte Klassen generiert, was den generierten Quellcode nicht schöner macht. Das Plugin lässt sich daher verwenden, um die import-Statements nachträglich zu erzeugen. Daher bietet das Plugin eine postprocessor-Komponente an, die sich in innerhalb einer Generator-Konfiguration einbinden lässt.
Hier geht es zu den Plugins.