Witam mam pewien problem z biblioteka XStream. Na poczatku myslalem, ze popelnilem jakis blad w moim kodzie, ale po pozniejszej analizie roznych tutoriali i zastosowaniu ich doszedlem do wniosku ze kod jest ok.
public class Test {
public static void main(String[] args) {
XStream xstream = new XStream();
Date date = new Date();
date.year = 2004;
date.month = 8;
date.day = 15;
xstream.alias("date", Date.class);
String xml = xstream.toXML(date);
System.out.print(xml);
}
}
public class Date {
int year = 2004;
int month = 8;
int day = 15;
}
Problem polega na tym, ze nie wyswietla sie struktura XML tylko wyskakuja informacje o bibliotece :
XStream JVM diagnostics
java.specification.version: 1.6
java.vm.vendor: Sun Microsystems Inc.
Version: 1.6
XStream support for enhanced Mode: true
Supports AWT: true
Supports Swing: true
Supports SQL: true
Reverse field order detected (may have failed): false
Biblioteki : http://www.java2s.com/Code/Jar/STUVWXYZ/Downloadxstream131jar.htm
i jeszcze do tego xpp
Zalaczenie bibliotek przez Properties - Java Build Path - Add External Jars - dodanie.
Z gory wielkie dzieki!!!