?? yweathernamespacecontext.java
字號:
/*
* YWeatherNamespaceContext.java
*
* Created on May 25, 2007, 2:34 PM
*
*/
package yweatherbeta;
import java.util.Iterator;
import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;
/**
*
* @author BEN
*/
public class YWeatherNamespaceContext implements NamespaceContext {
public String getNamespaceURI(String prefix) {
if (prefix == null) throw new NullPointerException("Null prefix");
else if ("yweather".equals(prefix)) return "http://xml.weather.yahoo.com/ns/rss/1.0";
else if ("geo".equals(prefix)) return "http://www.w3.org/2003/01/geo/wgs84_pos#";
else if ("xml".equals(prefix)) return XMLConstants.XML_NS_URI;
return XMLConstants.NULL_NS_URI;
}
// This method isn't necessary for XPath processing.
public String getPrefix(String uri) {
throw new UnsupportedOperationException();
}
// This method isn't necessary for XPath processing either.
public Iterator getPrefixes(String uri) {
throw new UnsupportedOperationException();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -