Revision 1447 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/persistence/xml/XMLPersistentStateWriter.java
XMLPersistentStateWriter.java | ||
---|---|---|
52 | 52 |
import org.gvsig.tools.persistence.PersistentContext; |
53 | 53 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
54 | 54 |
import org.gvsig.tools.persistence.exception.PersistenceTypeNotSupportedException; |
55 |
import org.gvsig.tools.persistence.spi.PersistentContextServices; |
|
55 | 56 |
import org.gvsig.tools.persistence.spi.PersistentContextServices.ObjectReference; |
56 | 57 |
import org.gvsig.tools.persistence.spi.PersistentStateServices; |
57 | 58 |
|
... | ... | |
172 | 173 |
// iter all states |
173 | 174 |
while (itStates.hasNext()) { |
174 | 175 |
curState = (PersistentStateServices) itStates.next(); |
175 |
writeState(curState); |
|
176 |
try { |
|
177 |
writeState(curState); |
|
178 |
} catch(Exception ex) { |
|
179 |
if( context.getCollectErrors() ) { |
|
180 |
context.addError(ex); |
|
181 |
} else { |
|
182 |
throw ex; |
|
183 |
} |
|
184 |
} |
|
176 | 185 |
|
177 | 186 |
} |
178 | 187 |
// States end: |
... | ... | |
198 | 207 |
Object value; |
199 | 208 |
|
200 | 209 |
itNames = curState.getNames(); |
210 |
if( itNames==null || ! itNames.hasNext() ) { |
|
211 |
// The state is empty. Don't output any thing. |
|
212 |
|
|
213 |
} |
|
214 |
|
|
201 | 215 |
String theClassName = curState.getTheClassName(); |
202 | 216 |
String tagName = getXMLValidName( theClassName); |
203 | 217 |
DynStruct definition = curState.getDefinition(); |
204 |
if( definition != null ) { |
|
218 |
|
|
219 |
if( definition != null ) { |
|
205 | 220 |
tagName = getXMLValidName( curState.getDefinition().getFullName() ); |
206 | 221 |
} |
207 | 222 |
|
Also available in: Unified diff