XStream
  1. XStream
  2. XSTR-194

? when assigned alias name doesn't overwrite the class name

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:
      None
    • JDK version and platform:
      1.4.2,winxp

      Description

      I don't know if it's a bug for sure but I have a case where the alias I assign doesn't get applied but instead the class name is included into the generated XML.

      public class XMLTemplate {
      static XStream xstream = new XStream();

      { xstream.alias("phr",PHRInfo.class); xstream.alias("license",LicenseInfo.class); xstream.alias("emergencycontact",EmergencyContact.class); xstream.alias("emergencyinformation",EmergencyInfo.class); }

      ...

      but in XML it produces

      <?xml version="1.0" encoding="UTF-8"?>
      <test.PHRInfo>
      <personalInfo>
      <contact>
      <firstName>Lorry</firstName>
      <email />
      </contact>
      <dob />
      <sex />
      <note />
      </personalInfo>
      <emergencyInfo>
      <list>
      <test.EmergencyContact>
      <contact>
      <firstName>ggg</firstName>
      <phone />
      <cell />
      </contact>
      <relation />
      </com.inzami.phr.EmergencyContact>
      ...

      Can you tell why the alias for com.inzami.phr.PHRInfo and com.inzami.phr.EmergencyContact do not get applied?

        People

        • Assignee:
          Unassigned
          Reporter:
          Ivan Zhidov
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: