public void copyBasicInfo(final XmlNode xmlNode) { if (xmlNode == null) { return; } final String name = xmlNode.getName(); final String value = xmlNode.getValue(); BasicInfo basicInfo = null; if (ERROR.equals(name)) { basicInfo = addError(); } else if (WARNING.equals(name)) { basicInfo = addWarning(); } else if (INFO.equals(name)) { basicInfo = addInfo(); } basicInfo.setValue(value); final Map<String, String> attributes = xmlNode.getAttributes(); for (final Entry<String, String> entry : attributes.entrySet()) { basicInfo.setAttribute(entry.getKey(), entry.getValue()); } }
private List<Conclusion.BasicInfo> getBasicInfo(final String signatureId, final String basicInfoType) { final List<XmlDom> elementList = getElements("/SimpleReport/Signature[@Id='%s']/" + basicInfoType, signatureId); final List<Conclusion.BasicInfo> infoList = new ArrayList<Conclusion.BasicInfo>(); for (final XmlDom infoElement : elementList) { Conclusion.BasicInfo basicInfo = new Conclusion.BasicInfo(basicInfoType); basicInfo.setValue(infoElement.getText()); final NamedNodeMap attributes = infoElement.getAttributes(); for (int index = 0; index < attributes.getLength(); index++) { final Node attribute = attributes.item(index); basicInfo.setAttribute(attribute.getNodeName(), attribute.getNodeValue()); } infoList.add(basicInfo); } return infoList; }
private void basicInfoToXmlNode(List<?> basicInfoList, final String infoLevel, final XmlNode conclusion) { if (basicInfoList != null) { for (final Object basicInfoObject : basicInfoList) { BasicInfo basicInfo = (BasicInfo) basicInfoObject; final XmlNode infoNode = conclusion.addChild(infoLevel, basicInfo.getValue()); for (final Entry<String, String> entry : basicInfo.attributes.entrySet()) { infoNode.setAttribute(entry.getKey(), entry.getValue()); } } } }
conclusion.addError(BBB_SAV_ICERRM_ANS).setAttribute(CERTIFIED_ROLES, certifiedRolesString).setAttribute(REQUESTED_ROLES, requestedCertifiedRolesString); return conclusion;
node.addChild(WARNING, BBB_VCI_ISPK_ANS_3).setAttribute(ERROR, processingError); final Conclusion.Warning warning = conclusion.addWarning(BBB_VCI_ISPK_ANS_3); warning.setAttribute(EXPECTED_VALUE, expectedValue).setAttribute("ConstraintValue", identifier); return true; conclusion.setIndication(INDETERMINATE, NO_POLICY); final Conclusion.Error error = conclusion.addError(BBB_VCI_ISPK_ANS_3); error.setAttribute(EXPECTED_VALUE, expectedValue).setAttribute("ConstraintValue", identifier); return false;
/** * @param nameId indicates the unique message identifier * @param tag indicates the info type: Info or Warning * @param value the value of the information */ protected BasicInfo(final String nameId, final String tag, final String value) { setAttribute(NAME_ID, nameId); this.tag = tag; this.value = value; }
/** * @param tag indicates the info type: Info or Warning * @param messageTag indicates the unique message identifier */ protected BasicInfo(final String tag, final MessageTag messageTag) { setAttribute(NAME_ID, messageTag.name()); this.tag = tag; this.value = messageTag.getMessage(); }
/** * @param tag indicates the info type: Info or Warning * @param messageTag indicates the unique message identifier * @param attributes the value of the information */ protected BasicInfo(final String tag, final MessageTag messageTag, final Map<String, String> attributes) { setAttribute(NAME_ID, messageTag.name()); this.tag = tag; this.value = messageTag.getMessage(); if (attributes != null) { this.attributes.putAll(attributes); } }
private void copyAttributes(final XmlDom xmlDom, final BasicInfo basicInfo) { final NamedNodeMap attributes = xmlDom.getAttributes(); for (int index = 0; index < attributes.getLength(); index++) { final Node attribute = attributes.item(index); final String attributeName = attribute.getNodeName(); final String attributeValue = attribute.getNodeValue(); basicInfo.setAttribute(attributeName, attributeValue); } }
/** * @param tag indicates the info type: Info or Warning * @param messageTag indicates the unique message identifier */ protected BasicInfo(final String tag, final MessageTag messageTag, final String... dynamicParameters) { setAttribute(NAME_ID, messageTag.name()); this.tag = tag; final String message = String.format(messageTag.getMessage(), dynamicParameters); this.value = message; }