is there a xsd.exe alternative with restriction support? - xsd.exe

I have generated some classes using the VS 2010 version of XSD.exe. This works well for the class relationships, but it does not support restrictions other than choices. I need support for maxLength and pattern. Is there an alternative tool that will generate classes with support for maxLength and pattern?

Related

How to convert owl to uml in Protege?

I am using protege 5 version,
How do I translate owl to uml ?,
Is there a uml diagram library for protege 5.x ?
This is an area that has interested me for some time. To the best of my knowledge there is no current tool to achieve this. There is a plugin for Protege4. See OWL2UML and this article. Another problem is that the plugin may only support an old version or subset of XMI.
If possible it may make sense to rather use Protege4. Or, if possible, you could attempt to do the translation by hand. You can find more on the OWL<-->UML translation on my website.

How to use an alternative(JAXB) to XStream for reading the solver configuration in optaplanner?

The optaplanner uses XStream for reading the solver configuration from XML. For using JAXB instead, is it sufficient to have custom implementation of XMLSolverFactory and SolverConfig?
No, because the *Config classes aren't annotated with JAXB annotations in 6.0.0.
There's a open discussion if we want to migrate from XStream to JAXB, so we can offer an XSD of the solver config.
Also note, that these 2 things are completely distinct:
read a solver configuration from XML
read a solution dataset from XML (~ProblemIO)
For 2), you can very easily replace XStreamProblemIO with a JaxbProblemIO (which should be easy to write).

Castor JAXB swaRef limitation

We are using Castor for marshalling/unmarhalling xsd:s. We are using attachments and refering to the with the "swaRef" element. According to this page Castor does not support this, http://docs.codehaus.org/display/CASTOR/Castor+JAXB:
Some of the functionality could require to be actually implemented in
backing Castor framework - for example handling the attachment
through MTOM/XOP and swaRef.
How can we overcome this limitation?
Note: I'm the EclipseLink JAXB (MOXy) lead and a member of the JAXB (JSR-222) expert group.
My recommendation would be to use a standard JAXB (JSR-222) implementation that supports everything you need (models generated from XML schema, swaref, etc) rather than implementing some workaround to use Castor. An implementation is included in the JDK/JRE as of Java SE 6, and other implementations (such as MOXy) are also available.
Note
Based on the link you provided it does not appear as though Castor has run the JAXB (JSR-222) compliance tests and in the "Functional testing" section on that page it appears as though Castor has not fully tested its support for the JAXB (JSR-222) annotations.
Functional testing
I think a little bit of time should be spend on
functional testing, and this might get quite tedious. Looking, for
example, at the #XmlAttribute annotation, there's a lot of variants to
test, requiring POJOs to be annotated slightly different for each test
case. That would require us to write a lot of POJOs and wire them up
accordingly in the test classes. Let's see whether we can agree on how
to go about this (layout, package structures, ...).

JVM languages for J2ME platform

I'm currently writing an embedded application for J2ME environment (CLDC 1.1 configuration and IMP-NG profile). Being spoiled by all those new features in JVM-based languages (Groovy, Scala, Clojure, you name it), I was considering using one of them for my code.
However, most of the mentioned languages require pretty decent JVM environment. Most so-called "dynamic" languages require the VM to have reflection. Many ask for annotations support. None of the above features are available under J2ME.
From what I found, Xtend looks like a viable options, as its compiler spits out plain Java, not bytecode, and doesn't require any library for runtime needs. Of course, the generated Java code also must meet some requirements, but Xtend webpage looks promising in this regard:
Xtend just does classes and nothing else
Interface definitions in Java are already nice and concise. They have a decent default visibility and also in other areas there is very little to improve. Given all the knowledge and the great tools being able to handle these files there is no reason to define them in a different way. The same applies for enums and annotation types.
That's why Xtend can do classes only and relies on interfaces, annotations and enums being defined in Java. Xtend is really not meant to replace Java but to modernize it.
Am I right and it is possible to compile Xtend-generated code for J2ME platform, or there are some constructs that will not work there?
Alternatively, can you recommend any other "rich" Java modification language that can be run on J2ME?
Update: Knowing that the "compiler" producing results as another source code is called transcompiler, one can also find Mirah, a tool which requires no runtime library and specific Java features.
Xtend's generated code uses google guava heavily. If that is compatible to the J2ME, Xtend could be the language of your choice. I'm not aware of anything that prevents from using it on other platforms that provide a dedicated development kit (e.g. Android).
In addition to being able to generate Java source, Mirah recently added support for javac's --bootclasspath option, which allows you to generate your bytecode against a non-standard version of the java core classes, e.g. LeJOS.
It's still a little fresh, but it'd be nice to have more people using it on different javas.

suppress Javadoc

when i compile a JAXB schema the generated classes are decorated with generic Javadoc comments.
is it somehow possible to suppress generating these comments?
Annotation to disable JavaDocs
Not if you're using Sun's JavaDocs tool.
They have a feature request for it, but it's been in low priority since 1997.
You can write a custom doclet to overcome this, or use a 3rd-party tool (DocFlex or such).

Resources