mapprepostsethandler.java
来自「目前在JAVA下编程时对XML的操作很重要」· Java 代码 · 共 37 行
JAVA
37 行
package com.extension;
import com.weather.LocalWeatherDocumentXmlBean.LocalWeather;
import org.apache.xmlbeans.*;
import javax.xml.namespace.QName;
public class MapPrePostSetHandler {
/**
* Returns false, if Client application tries to modify map represented by contents of image element.
*/
public static boolean preSet(int operationType, XmlObject xo, QName propertyName, boolean isAttr, int indexOfItem) {
javax.xml.namespace.QName imageQName = new javax.xml.namespace.QName("http://www.helloWeather.com/weather","image");
// If xmlbeans object is an instance of com.weather.LocalWeatherDocumentXmlBean.LocalWeather, and
// property to be modified is image element belonging to "http://www.helloWeather.com/weather" namespace,
// then return false, else return true.
if( (xo instanceof LocalWeather) && ( propertyName.equals(imageQName) ) )
{
return false;
}
return true;
}
/**
* Empty
*/
public static void postSet(int operationType, XmlObject xo, QName propertyName, boolean isAttr, int indexOfItem) {
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?