本文整理汇总了Java中javax.xml.bind.JAXBException.getLocalizedMessage方法的典型用法代码示例。如果您正苦于以下问题:Java JAXBException.getLocalizedMessage方法的具体用法?Java JAXBException.getLocalizedMessage怎么用?Java JAXBException.getLocalizedMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.bind.JAXBException
的用法示例。
在下文中一共展示了JAXBException.getLocalizedMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClusterVersion
import javax.xml.bind.JAXBException; //导入方法依赖的package包/类
/**
* @return string representing the cluster's version
* @throws IOException
* if the endpoint does not exist, there is a timeout, or some other
* general failure mode
*/
public StorageClusterVersionModel getClusterVersion() throws IOException {
StringBuilder path = new StringBuilder();
path.append('/');
if (accessToken != null) {
path.append(accessToken);
path.append('/');
}
path.append("version/cluster");
int code = 0;
for (int i = 0; i < maxRetries; i++) {
Response response = client.get(path.toString(), Constants.MIMETYPE_XML);
code = response.getCode();
switch (code) {
case 200:
try {
return (StorageClusterVersionModel) getUnmarsheller().unmarshal(
new ByteArrayInputStream(response.getBody()));
} catch (JAXBException jaxbe) {
throw new IOException(
"Issue parsing StorageClusterVersionModel object in XML form: "
+ jaxbe.getLocalizedMessage());
}
case 404:
throw new IOException("Cluster version not found");
case 509:
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}
break;
default:
throw new IOException(path.toString() + " request returned " + code);
}
}
throw new IOException("get request to " + path.toString()
+ " request timed out");
}