I'm looking to update our project's jaxb version from 1 to 2. Has anyone tried doing this on their projects and are there any tips that anyone wanting to do ... |
I have Java classes with the following structure (the class names do not imply anything, I was just making them up).
package test;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import ...
|
I have an xsd that looks like this (snippet):
<xs:complexType name="IDType">
<xs:choice minOccurs="1" maxOccurs="2">
<xs:element name="FileID" minOccurs="0" maxOccurs="1" type="an..35" />
<xs:element name="IDNumber1" ...
|
I would like generate an AST from my XML-definition, to be used for code generation later on.
The XML schema is written in Relax NG, since it seemed like a neater ... |
First attempt to use this cool site - after searching for 2 hours:
So I have a Java Bean that is given (I can only annotate not change) and need to map ... |
I don't want to use XML file created by JAXB marshaller, can I customize it, so that i would give a preferrable format to marshal objects?
|
JAXB works well until I need to do something like serialize beans for which I cannot modify the source. If the bean doesn't have a default constructor or if it refers ... |
|
Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in account the performance for files bigger then 10Mb?
|
I am using JAXB for xml parsing, are there any performance or memory utilization issues?
|
If I have 3 objects A, B and C. Where A has B which has C, I don't want to show
<a>
<b>
<c/>
</b>
</a>
I want ... |
Is there a way to tell JAXB to not remove underscores when creating getter/setter names from XML Schema?
Reason: this causes loss of information and it is harder to trip between XML ...
|
Let's say I've got my domain objects laid out so the XML looks like this:
<account id="1">
<name>Dan</name>
<friends>
<friend id="2">
<name>RJ</name>
...
|
At https://jaxb.dev.java.net/ it says JAXB its under dual license consisting of the CDDL v1.0 and GPL v2;
And CDDL says:
- Distribution Obligations
3.1. Availability of Source Code.
Any Covered Software that You ...
|
I am currently designing a solution to a problem I have. I need to dynamically generate an XML file on the fly using Java objects, in the same way JAXB generates ... |
My java module gets a huge input xml from a mainframe. Unfortunately, the mainframe is unable to skip optional elements, with the result that I get a LOT of empty ... |
I am using JAXB to serialize my data to XML. The class code is simple as given below. I want to produce XML that contains CDATA blocks for the value of ... |
I am using Jersey and JAXB to build a simple RESTful webservice
I have a HashMap of 'String' to 'Integer':
2010-04 -> 24
2010-05 -> 45
I need to generate an XML response which ... |
I'm trying to choose an XML-processing framework for my Java projects, and I'm lost in names.. XOM, JDOM, etc. Where I can find a detailed comparison of all popular Java XML ... |
I have a legacy class, with a lot of public double fields. All double fields are initialized with Double.MAX_VALUE to indicate that they are empty. (The legacy serialization is coded to ... |
I have two class, Node and Group, the Group is Node's sub-class.
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Node", propOrder = {
"id",
"children"
})
public class Node {
...
|
We are using JAXB to generate Java classes and have encountered a few cases where generated plural method names are not correct. For example, where we expect getPhysicians we are getting ... |
In ActionScript 3, how to decode from xml to ActionScript class ?
I could encode from ActionScript class to xml by using XmlEncoder.
The xml schema I used at that time is this.
[schema1.xsd]
<?xml ...
|
In my current project I have a requirement where I need to build an xml document. I am planning to go with JAXB by creating the Java domain classes and marshall ... |
I need to generate classes from xml that doesn't provide a schema. I understand this is near useless, but the fact is we have xml, it's structured, and we should be ... |
I am working in an application where we need to save objects in XML format, and load them later once required. For this I have used JAXB to marshall and unmarshall ... |
I get an InputStream from a web services call, and I use JAXB to convert it to objects, so I do not have to parse the xml.
The objects contain a bunch ... |
<?xml version='1.0'?>
<info>
<contract>
<symbol>IBM</symbol>
<sectype>STK</sectype>
<exchange>SMART</exchange>
...
|
Because of increasing configuration complexity, I want to introduce XML for my library's configuration files, and replace the existing properties files.
I would like to
- Publicly describe the XML structure with XSD (so ...
|
@XmlRootElement(name = "toplist")
class toplist {
private String description;
private List<Item> items= new ArrayList<Item>();
@XmlElement(name = "description")
public String getDescription() ...
|
Is there a way to specify the Adapter which JAXB uses for marshaling/unmarshaling objects in my XML schema?
For example, if I want to parse the following as an integer:
<SpecialValue>0x1234</SpecialValue>
I can use ... |
I want to keep comments, ordering, etc. in the document and edit the document in-place using a Java interface.
Does JAXB do this?
Do other tools such as XMLBeans do this?
|
I had written a lot of java bean classes using my IDE. Another person suggests a different approach. He suggests that I put an xml file with bean definitions in them. ... |
Given the following class:
public class Customer {
public String name;
public String lastName;
}
I want to generate the following xml output using JAXB for a customer whose name is John ... |
For the life of me I cannot figure out why this is happening to my code.
I wrote a java program to add a block of XML to an existing XML file. ... |
I'm trying to map a xml DateTime element using jaxb so that it does not care about timezone information at all. Either by rejecting the input, or by treating it as ... |
I'm currently working on replacing a legacy system with JAXB and I'm running into problem with parsing the XML. The number one requirement of the system is that it must be ... |
In my current JAXB marshaller application, I need to conditionally write an element into xml.
Let me see if I can think of an example without making it sound like a ... |
Basically, I have a project set up in Restlet which uses JAXRS for mapping resources to paths and uses JAXB for serializing and deserializing XML to/from Java types. I'm currently trying ... |
I am receving an XML file as an input, whose size can vary from a few KBs to a lot more. I am getting this file over a network. I need ... |
I have an xml that looks like this:
<Root>
<tag1>4</tag1>
<tag2>aa</tag2>
<tag3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<anyType xsi:type="xsd:string">bla bla bla</anyType>
...
|
I have a Tomcat server app, which creates xml responses based on classes I populate.
One of the classes has a date field:
@XmlRootElement
public class Login {
private String mLoginUserID;
...
|
I am software written in Java which read an external XML file (let's call it "datasource.xml").
This file contains different information and this information are extracted using XPath queries.
The fact is that, ... |
I would like to configure JAXB so that it trims whitespaces on all string fields
I saw the following answer : How to configure JAXB so it trims whitespaces when unmarshalling ... |
Following the tutorial given in http://blog.adamsbros.org/2010/02/07/jaxb-example-code/ I'd like to know if it is possible to have variable number of XMLElements.
For example, my class will be:
@XmlRootElement(name = "employee")
public class Teacher ...
|
One thing that prevents from using a binding technology like JAXB, instead of a classic dom/sax-based xml technology is the fact that, when reading xml, it seems to be strongly oriented ... |
I've just started using JAXB to make XML output from java objects. A polymorphism exists in my java classes, which seems to not working in JAXB.
Below is the way how ... |
I am trying to build server that sends a xml file to client. I am getting info from db and wants to build from that xml file.
But I have a problem ... |
I wamt to generate xml from java class using JAXB from a bean class,please let me know which are different approaches for the same.
I have tried one from ... |
This is my scenario. I have a generic class:
public class Tuple<T> extends ArrayList<T> {
//...
public Tuple(T ...members) {
this(Arrays.asList(members));
}
@XmlElementWrapper(name = "tuple")
...
|
Suppose i have an object
@XmlRootElement(name = "publisher")
class Person
{
@XmlElement(required = true)
int id;
@XmlElement(required = true)
String name;
}
I want to generate like
<person>
<id>1</id>
<name>test</name>
</person>
Suppose if the name is test10 I dont want ... |
I need to add schemaLocation Property that is nested on another object,
I have a class...
...
@XmlRootElement(name = "Comp")
public class Comp {
...
I marshall objects of this class setting Marshaller.JAXB_SCHEMA_LOCATION and it works ... |
I'm trying to process some XML files using the JAXB implementation shipped in Java 7. I'm using these versions :
501 ~ % xjc -version
xjc 2.2.4
502 ~ %java -version ...
|
Hey guys, I am using an xsd to generate an xml file. For this I'm using jaxb from "https://jaxb.dev.java.net/2.1.9/JAXB2_20081030.jar". I have successfully managed to create marshal for a context and generated ... |
A writeXLM method would return a chunk of XML for that one object, and perhaps contained objects. For example, if my Person class had only one field for name, it might just say: return "" + getName() + ""; That approach bakes the ability to build XML right into every class. That doesn't go well with the Single Responsibility Principle, or ... |
|
Hi All, I am trying read an XML document using Jaxb in my java program. the problem is that ,Since I am using jdk1.3 in my Ibm -wsad IDE v5.1 , I am unable to do it. Its easy to implement this in Jdk 1.4 and higher level. Please suggest which jars need to be included to run my program. I ... |