Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:48:51+00:00 2026-06-14T08:48:51+00:00

<ProductInformation Context=GL> <Assets> <Asset ID=assetID UserTypeID=ID> <Name>name</Name> <Reference ClassificationID=id/> <Values> <Value AttributeID=ID>Value1</Value> <Value AttributeID=ID>Value2</Value>

  • 0
<ProductInformation Context="GL">
 <Assets>
  <Asset ID="assetID" UserTypeID="ID">
    <Name>name</Name>
    <Reference ClassificationID="id"/>
      <Values>
        <Value AttributeID="ID">Value1</Value>
        <Value AttributeID="ID">Value2</Value>
          <MultiValue AttributeID="attributeID">
             <Value>value3a</Value>
             <Value>value3b</Value>
          </MultiValue>
     </Values>
   </Asset>
 </Assets>

 <Products>....</Products>

</ProductInformation>

I used this xml->xsd and xjc to create classes from it.

Now I want to create my ProductInformation object,and marshall it.

My problem is xjc create 3 classes and a objectfactory, and some nested classes inside ProductInformation. When I look at the avaliable methods I mostly see getters instead of setters.

“Asset” class has no such methods like;

asset.setValues(List<Value> values)

Also I ended up writing funny code like this;

ProductInformation.Assets.Asset.Values.MultiValue multivalue=new ProductInformation.Assets.Asset.Values.MultiValue();

Is this normal with Jaxb?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:48:53+00:00Added an answer on June 14, 2026 at 8:48 am

    The way JAXB normally handles multi valued properties is to provide just a getter and no setter for the List<Whatever>, which returns a mutable list – you’re supposed to call the getter to retrieve an initially-empty list and then create the member objects for this list using new in the normal way and add them directly to the list. You can new a static nested class in exactly the same way as a top-level one.

    Single-valued properties (not lists) should have been generated with both getter and setter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataGridView filled with productinformation. The datagridview has totally 50 columns but
<rich:tree switchType=client value=#{Bean.tree} var=one> <rich:treeNode> <h:commandLink value=#{one.item1} action=#{Bean.getItem()} style=color:blue;text-decoration:none; title=Click here to view details>
First of All here's the Codes: Product Information: public class ProductInformation { public String
I have a string: [{product_id:2,name:'stack'},{product_id:2,name:overflow}] How can I use Flexjson's JSONDeserializer to obtain all
I want to return to my view Product information(Name and Cost) and am running
Using this code generated from googles analytic product: (information censored) <meta name=google-site-verification content=xxxxxxxxxxxx />
I'm trying to retrieve product information from magento by calling its web service using
I have a table of product information with many bit columns. This table can
I am developing an app which uses barcode to get the product information of
Interesting challenge; my client enters some product information in a SQL database. The product

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.