src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java
Print this page
@@ -145,24 +145,24 @@
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
// create or obtain the Map object
try {
- BeanT target = (BeanT) state.prev.target;
+ BeanT target = (BeanT) state.getPrev().getTarget();
ValueT mapValue = acc.get(target);
if(mapValue == null)
mapValue = ClassFactory.create(mapImplClass);
else
mapValue.clear();
Stack.push(this.target, target);
Stack.push(map, mapValue);
- state.target = mapValue;
+ state.setTarget(mapValue);
} catch (AccessorException e) {
// recover from error by setting a dummy Map that receives and discards the values
handleGenericException(e,true);
- state.target = new HashMap();
+ state.setTarget(new HashMap());
}
}
@Override
public void leaveElement(State state, TagName ea) throws SAXException {
@@ -175,11 +175,11 @@
}
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
if(ea.matches(entryTag)) {
- state.loader = entryLoader;
+ state.setLoader(entryLoader);
} else {
super.childElement(state,ea);
}
}
@@ -195,30 +195,30 @@
* The target will be set to a {@link Map}.
*/
private final Loader entryLoader = new Loader(false) {
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) {
- state.target = new Object[2]; // this is inefficient
+ state.setTarget(new Object[2]); // this is inefficient
}
@Override
public void leaveElement(UnmarshallingContext.State state, TagName ea) {
- Object[] keyValue = (Object[])state.target;
- Map map = (Map) state.prev.target;
+ Object[] keyValue = (Object[])state.getTarget();
+ Map map = (Map) state.getPrev().getTarget();
map.put(keyValue[0],keyValue[1]);
}
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
if(ea.matches(keyTag)) {
- state.loader = keyLoader;
- state.receiver = keyReceiver;
+ state.setLoader(keyLoader);
+ state.setReceiver(keyReceiver);
return;
}
if(ea.matches(valueTag)) {
- state.loader = valueLoader;
- state.receiver = valueReceiver;
+ state.setLoader(valueLoader);
+ state.setReceiver(valueReceiver);
return;
}
super.childElement(state,ea);
}
@@ -232,11 +232,11 @@
private final int index;
public ReceiverImpl(int index) {
this.index = index;
}
public void receive(UnmarshallingContext.State state, Object o) {
- ((Object[])state.target)[index] = o;
+ ((Object[])state.getTarget())[index] = o;
}
}
private static final Receiver keyReceiver = new ReceiverImpl(0);
private static final Receiver valueReceiver = new ReceiverImpl(1);