本文整理汇总了Java中com.sun.org.apache.xerces.internal.dom.ElementNSImpl类的典型用法代码示例。如果您正苦于以下问题:Java ElementNSImpl类的具体用法?Java ElementNSImpl怎么用?Java ElementNSImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ElementNSImpl类属于com.sun.org.apache.xerces.internal.dom包,在下文中一共展示了ElementNSImpl类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endElement
import com.sun.org.apache.xerces.internal.dom.ElementNSImpl; //导入依赖的package包/类
public void endElement(QName element, Augmentations augs)
throws XNIException {
final Node currentElement = fDOMValidatorHelper.getCurrentElement();
// Write type information to this element
if (augs != null && fDocumentImpl != null) {
ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elementPSVI != null) {
if (fStorePSVI) {
((PSVIElementNSImpl) currentElement).setPSVI(elementPSVI);
}
XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
if (type == null) {
type = elementPSVI.getTypeDefinition();
}
((ElementNSImpl) currentElement).setType(type);
}
}
}
示例2: endElement
import com.sun.org.apache.xerces.internal.dom.ElementNSImpl; //导入依赖的package包/类
public void endElement(QName element, Augmentations augs)
throws XNIException {
// write type information to this element
if (augs != null && fDocumentImpl != null) {
ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elementPSVI != null) {
if (fStorePSVI) {
((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
}
XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
if (type == null) {
type = elementPSVI.getTypeDefinition();
}
((ElementNSImpl)fCurrentNode).setType(type);
}
}
// adjust current node reference
if (fCurrentNode == fFragmentRoot) {
fCurrentNode = null;
fFragmentRoot = null;
return;
}
fCurrentNode = fCurrentNode.getParentNode();
}
示例3: getValue
import com.sun.org.apache.xerces.internal.dom.ElementNSImpl; //导入依赖的package包/类
@JsonSerialize(using = MetadataObjectValueSerializer.class)
public Object getValue() {
if (value instanceof ElementNSImpl){
ElementNSImpl v = (ElementNSImpl)value;
if (v.getFirstChild().getNodeValue() instanceof String){
value = (String)v.getFirstChild().getNodeValue();
}
}
return value;
}
示例4: getHttpNfcLeaseState
import com.sun.org.apache.xerces.internal.dom.ElementNSImpl; //导入依赖的package包/类
public static String getHttpNfcLeaseState(final ConnectionResources connectionResources, final ManagedObjectReference httpNfcLease) throws Exception {
final ObjectContent objectContent = GetObjectProperties.getObjectProperty(connectionResources, httpNfcLease, "state");
final List<DynamicProperty> dynamicProperties = objectContent.getPropSet();
if (dynamicProperties.size() != 0) {
return ((TextImpl) ((ElementNSImpl) dynamicProperties.get(0).getVal()).getFirstChild()).getData();
}
throw new Exception(LEASE_STATE_COULD_NOT_BE_OBTAINED);
}
示例5: parseRegTLSMessage
import com.sun.org.apache.xerces.internal.dom.ElementNSImpl; //导入依赖的package包/类
public static RegistryTLSResult parseRegTLSMessage(String TLSResp) {
RegistryTLSResult result = null;
try {
TLSProcessor tlsp = new TLSProcessor().init();
TLS raw = tlsp.parse(TLSResp);
result = new RegistryTLSResult();
for (Object o : raw.getAny()) {
if (o instanceof JAXBElement) {
JAXBElement e = (JAXBElement) o;
final String value = e.getValue() == null ? "" : e.getValue().toString();
final String name = e.getName().getLocalPart();
if (name.equals(TLSResult.OK_MSG)) {
result.setOkMsg(value);
} else if (name.equals(TLSResult.ERR_MSG)) {
result.setErrMsg(value);
} else if (name.equals(TLSResult.RET_CODE)) {
result.setRetCode(Integer.parseInt(value));
} else if (name.equals(TLSResult.PRT_MSG)) {
result.setPrtMsg(value);
} else if (name.equals(RegistryTLSResult.APP_RESTART_SIGNAL)) {
result.setAppRestartSignal(Integer.parseInt(value));
} else if (name.equals(RegistryTLSResult.DOWNLOAD_KEY_SIGNAL)) {
result.setDownloadKeySignal(Integer.parseInt(value));
} else if (name.equals(RegistryTLSResult.SYS_RESTART_SIGNAL)) {
result.setSystemRestartSignal(Integer.parseInt(value));
} else if (name.equals(RegistryTLSResult.APP_UPDATE_SIGNAL)) {
result.setAppUpdateSignal(Integer.parseInt(value));
} else if (name.equals(RegistryTLSResult.APP_UPDATE_FILE)) {
result.setAppUpdateFile(value);
} else {
getLogger(CommonUtil.class.getName()).log(Level.CONFIG,
"Unuseful registry response JAXBElement : {0}", e.getName().toString());
}
// As switch clause cannot support constant in runtime,
// you have to give final string in compile time. I have to
// use ifelse clause instead, because I set constant like
// APP_UPDATE_MD5 using QName.getlocalPart()
/*switch (name) {
case TLSResult.OK_MSG:
result.setOkMsg(value);
break;
case TLSResult.ERR_MSG:
result.setErrMsg(value);
break;
case TLSResult.RET_CODE:
result.setRetCode(Integer.parseInt(value));
break;
case TLSResult.PRT_MSG:
result.setPrtMsg(value);
break;
case RegistryTLSResult.APP_RESTART_SIGNAL:
result.setAppRestartSignal(Integer.parseInt(value));
break;
case RegistryTLSResult.DOWNLOAD_KEY_SIGNAL:
result.setDownloadKeySignal(Integer.parseInt(value));
break;
case RegistryTLSResult.SYS_RESTART_SIGNAL:
result.setSystemRestartSignal(Integer.parseInt(value));
break;
case RegistryTLSResult.VERSION:
result.setVersion(value);
break;
default:
getLogger(CommonUtil.class.getName()).log(Level.CONFIG,
"Unuseful registry response JAXBElement : {0}", e.getName().toString());
}*/
} else {
getLogger(CommonUtil.class.getName()).log(Level.CONFIG,
"Unuseful registry response com.sun.org.apache.xerces.internal.dom.ElementNSImpl Element : {0} with value {1}",
new Object[]{((ElementNSImpl) o).getLocalName(), ((ElementNSImpl) o).getFirstChild().getNodeValue()});
}
}
} catch (JAXBException | NumberFormatException | DOMException ex) {
getLogger(CommonUtil.class.getName()).log(Level.SEVERE, null, ex);
}
return result;
}
示例6: strikeBalance
import com.sun.org.apache.xerces.internal.dom.ElementNSImpl; //导入依赖的package包/类
protected String strikeBalance(Map<Integer, String> conditionValues, String previousMsg, String errMsg) throws Exception {
String strike_balance = buildBalancedMsg(conditionValues, previousMsg);
//add balance MAC
TLSProcessor tlsProcess = new TLSProcessor().init();
TLS strikeTLS = tlsProcess.parse(strike_balance);
TLS previousTLS = tlsProcess.parse(previousMsg);
for (Object tag : previousTLS.getAny()) {
JAXBElement element = null;
if (tag instanceof ElementNSImpl) {
ElementNSImpl rawElement = (ElementNSImpl) tag;
element = CommonUtil.createJAXBElement(new QName(rawElement.getLocalName()), rawElement.getTextContent());
} else {
element = (JAXBElement) tag;
}
switch (element.getName().getLocalPart()) {
case TLSResult.UNIONPAY_CARD_INFO:
case TLSResult.UNIONPAY_MAC_INFO:
strikeTLS.getAny().add(element);
break;
default:
break;
}
}
final String balancedPayMac = CommonUtil.retrieveCargo(
CommonConstants.BALANCED_PAY_MAC);
if (balancedPayMac != null) {
strikeTLS.getAny().add(CommonUtil.createJAXBElement(
TLSResult.BALANCE_UNIONPAY_MAC_INFO,
balancedPayMac));
CommonUtil.cleanTranStation(
CommonConstants.BALANCED_PAY_MAC);
}
strike_balance = tlsProcess.buildTLS(strikeTLS);
getLogger(BalanceTRXTask.class.getName()).log(Level.INFO,
"Sending balanced transaction TLS Message : \n{0}", strike_balance);
String resp = null;
try {
if (cmdCode < 0) {
resp = sendMessage(strike_balance);
} else {
resp = sendMessage(cmdCode, strike_balance);
}
} catch (Exception exception) {
getLogger(BalanceTRXTask.class.getName()).log(Level.WARNING,
"Fail to send strike-balance message due to : {0}", exception.getMessage());
throw exception;
} finally {
showErrMsg(Integer.MIN_VALUE, errMsg);
}
return resp;
}