
com.windowsazure.samples.internal.xml.AzureDOMAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jpa4azure Show documentation
Show all versions of jpa4azure Show documentation
jpa4azure, implements a subset of the JPA specification using Azure Storage for pesisting beans. see http://jpa4azure.codeplex.com for more information.
package com.windowsazure.samples.internal.xml;
import com.windowsazure.samples.internal.web.XmlHttpResult;
public abstract class AzureDOMAdapter extends DOMAdapter {
public AzureDOMAdapter(XmlHttpResult xmlHttpResult) {
super(xmlHttpResult.getXmlString());
this.xmlHttpResult = xmlHttpResult;
}
public abstract T build() throws Exception;
protected AzureDOMAdapter(XmlNode node) {
super(node);
}
protected String extractTableNameFromEntityId(String idText) {
int beginIndex = idText.lastIndexOf('/') + 1;
int endIndex = idText.indexOf('(', beginIndex);
if (endIndex == -1)
endIndex = idText.length();
return idText.substring(beginIndex, endIndex);
}
protected String extractTableNameFromTableId(String idText) {
int beginIndex = idText.indexOf('\'') + 1;
int endIndex = idText.indexOf('\'', beginIndex);
return idText.substring(beginIndex, endIndex);
}
protected String getErrorCode()
throws NodeNotFoundException {
XmlNode errorNode = getRootNode();
if (errorNode.getLocalName().compareTo("error") != 0)
return null;
return getInnerText(errorNode, "code");
}
protected XmlHttpResult xmlHttpResult;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy