/** * Get the value node at the end of this name/value chain. * @param header The message header that contains the name/value tree. * @oaram bAddIfNotFound Add the value if it is not found. * @return The node at the end of the name/value tree. */ public NameValue getNameValueLeaf(BaseMessageHeader header, boolean bAddIfNotFound) { Object[][] mxString = header.getNameValueTree(); NameValue node = this; if (mxString != null) { for (int i = 0; i < mxString.length; i++) { node = node.getNameValueNode((String)mxString[i][MessageConstants.NAME], mxString[i][MessageConstants.VALUE], bAddIfNotFound); if (node == null) return null; } } return node; } /**
/** * Get the value nodes in this name/value chain. * @param header The message header that contains the name/value tree. * @oaram bAddIfNotFound Add the value if it is not found. * @return The node at the end of the name/value tree. */ public NameValue[] getNameValueArray(BaseMessageHeader header) { Object[][] mxString = header.getNameValueTree(); NameValue[] rgNodes = new NameValue[10]; rgNodes[0] = this; int i = 0; if (mxString != null) { for (; i < mxString.length; i++) { rgNodes[i + 1] = rgNodes[i].getNameValueNode((String)mxString[i][MessageConstants.NAME], mxString[i][MessageConstants.VALUE], false); if (rgNodes[i + 1] == null) break; } } NameValue[] rgNodesNew = new NameValue[i + 1]; for (int j = 0; j <= i; j++) { rgNodesNew[j] = rgNodes[j]; } return rgNodesNew; } /**
Object[][] mxString = messageHeader.getNameValueTree(); NameValue node = this; int iIndex = -1;