/** * Sets the namespaceURI, localpart, and prefix on the supplied QName to the supplied values respectively. * @param qnameEObject The properties on this QName will be set. If the QName does not belong to a Resource, * the version is assumed to be J2EE 1.4. * @param namespaceURI The namespaceURI * @param localPart The localPart * @param prefix The prefix. Used in JSR-109 v1.1 only. This is the prefix that will be used for the namespace declaration If the supplied prefix is null or of length 0, the existing prefix is used. If no prefix exists, and this * is a JSR-109 v1.1 descriptor the default prefix defined in DEFAULT_PREFIX is used. * @return boolean Returns true if values were set successfully. False otherwise. */ public static void setQNameValue(QName qnameEObject, String namespaceURI, String localPart, String prefix) { int versionID; //Get the versionID from the QName's Resource if available J2EEVersionResource res = (J2EEVersionResource)qnameEObject.eResource(); if (res == null) { //use a J2EE 1.4 version ID as the default versionID = J2EEVersionConstants.J2EE_1_4_ID; } else { versionID = res.getJ2EEVersionID(); } setQNameValue(qnameEObject, namespaceURI, localPart, prefix, versionID); }