Revision 2772
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/persistence/xml/XMLPersistentConstants.java | ||
---|---|---|
366 | 366 |
public static final String TYPE_LIST = "list"; |
367 | 367 |
public static final String TYPE_REFERENCE = "reference"; |
368 | 368 |
public static final String TYPE_BOOLEAN = "boolean"; |
369 |
public static final String TYPE_BYTE = "byte"; |
|
369 | 370 |
public static final String TYPE_INTEGER = "integer"; |
370 | 371 |
public static final String TYPE_LONG = "long"; |
371 | 372 |
public static final String TYPE_FLOAT = "float"; |
... | ... | |
376 | 377 |
public static final String TYPE_URI = "uri"; |
377 | 378 |
public static final String TYPE_BIGDECIMAL = "bigdecimal"; |
378 | 379 |
public static final List TYPES_NUMBER = Collections.unmodifiableList(Arrays |
379 |
.asList(new String[] { TYPE_INTEGER, TYPE_LONG, TYPE_FLOAT, |
|
380 |
.asList(new String[] { TYPE_BYTE, TYPE_INTEGER, TYPE_LONG, TYPE_FLOAT,
|
|
380 | 381 |
TYPE_DOUBLE, TYPE_BIGDECIMAL })); |
381 | 382 |
|
382 | 383 |
|
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/persistence/xml/XMLPersistentStateReader.java | ||
---|---|---|
324 | 324 |
String value = parser.nextText().trim(); |
325 | 325 |
Number number = null; |
326 | 326 |
try { |
327 |
if (TYPE_INTEGER.equals(type)){
|
|
327 |
if (TYPE_BYTE.equals(type)){
|
|
328 | 328 |
if( value.startsWith("0x") ) { |
329 |
number = new Integer(Byte.parseByte(value.substring(2), 16)); |
|
330 |
} else { |
|
331 |
number = new Integer(Byte.parseByte(value)); |
|
332 |
} |
|
333 |
} else if (TYPE_INTEGER.equals(type)){ |
|
334 |
if( value.startsWith("0x") ) { |
|
329 | 335 |
number = new Integer(Integer.parseInt(value.substring(2), 16)); |
330 | 336 |
} else { |
331 | 337 |
number = new Integer(value); |
Also available in: Unified diff