/** * Wrapper around XmlSchemaElement.setName that checks for inconsistency with * refName. * @param element * @param name */ public static void setElementName(XmlSchemaElement element, String name) { if (name != null && element.isRef() && !element.getRef().getTargetQName().getLocalPart().equals(name) && (element.getQName() == null || element.getQName().getLocalPart().equals(name))) { LOG.severe("Attempt to set the name of an element with a reference name."); throw new XmlSchemaInvalidOperation("Attempt to set the name of an element " + "with a reference name."); } element.setName(name); }
/** * Wrapper around XmlSchemaElement.setRefName that checks for inconsistency with * name and QName. * @param element * @param name */ public static void setElementRefName(XmlSchemaElement element, QName name) { if (name != null && ((element.getQName() != null && !element.getQName().equals(name)) || (element.getName() != null && !element.getName().equals(name.getLocalPart())))) { LOG.severe("Attempt to set the refName of an element with a name or QName"); throw new XmlSchemaInvalidOperation("Attempt to set the refName of an element " + "with a name or QName."); } element.getRef().setTargetQName(name); // cxf conventionally keeps something in the name slot. }
/** * Wrapper around XmlSchemaElement.setName that checks for inconsistency with * refName. * @param element * @param name */ public static void setElementName(XmlSchemaElement element, String name) { if (name != null && element.isRef() && !element.getRef().getTargetQName().getLocalPart().equals(name) && (element.getQName() == null || element.getQName().getLocalPart().equals(name))) { LOG.severe("Attempt to set the name of an element with a reference name."); throw new XmlSchemaInvalidOperation("Attempt to set the name of an element " + "with a reference name."); } element.setName(name); }
/** * Wrapper around XmlSchemaElement.setRefName that checks for inconsistency with * name and QName. * @param element * @param name */ public static void setElementRefName(XmlSchemaElement element, QName name) { if (name != null && ((element.getQName() != null && !element.getQName().equals(name)) || (element.getName() != null && !element.getName().equals(name.getLocalPart())))) { LOG.severe("Attempt to set the refName of an element with a name or QName"); throw new XmlSchemaInvalidOperation("Attempt to set the refName of an element " + "with a name or QName."); } element.getRef().setTargetQName(name); // cxf conventionally keeps something in the name slot. }
/** * Wrapper around XmlSchemaElement.setRefName that checks for inconsistency with * name and QName. * @param element * @param name */ public static void setElementRefName(XmlSchemaElement element, QName name) { if (name != null && ((element.getQName() != null && !element.getQName().equals(name)) || (element.getName() != null && !element.getName().equals(name.getLocalPart())))) { LOG.severe("Attempt to set the refName of an element with a name or QName"); throw new XmlSchemaInvalidOperation("Attempt to set the refName of an element " + "with a name or QName."); } element.getRef().setTargetQName(name); // cxf conventionally keeps something in the name slot. }
/** * Wrapper around XmlSchemaElement.setName that checks for inconsistency with * refName. * @param element * @param name */ public static void setElementName(XmlSchemaElement element, String name) { if (name != null && element.isRef() && !element.getRef().getTargetQName().getLocalPart().equals(name) && (element.getQName() == null || element.getQName().getLocalPart().equals(name))) { LOG.severe("Attempt to set the name of an element with a reference name."); throw new XmlSchemaInvalidOperation("Attempt to set the name of an element " + "with a reference name."); } element.setName(name); }
/** * Wrapper around XmlSchemaElement.setRefName that checks for inconsistency with * name and QName. * @param element * @param name */ public static void setElementRefName(XmlSchemaElement element, QName name) { if (name != null && ((element.getQName() != null && !element.getQName().equals(name)) || (element.getName() != null && !element.getName().equals(name.getLocalPart())))) { LOG.severe("Attempt to set the refName of an element with a name or QName"); throw new XmlSchemaInvalidOperation("Attempt to set the refName of an element " + "with a name or QName."); } element.getRef().setTargetQName(name); // cxf conventionally keeps something in the name slot. }
/** * Wrapper around XmlSchemaElement.setRefName that checks for inconsistency with * name and QName. * @param element * @param name */ public static void setElementRefName(XmlSchemaElement element, QName name) { if (name != null && ((element.getQName() != null && !element.getQName().equals(name)) || (element.getName() != null && !element.getName().equals(name.getLocalPart())))) { LOG.severe("Attempt to set the refName of an element with a name or QName"); throw new XmlSchemaInvalidOperation("Attempt to set the refName of an element " + "with a name or QName."); } element.getRef().setTargetQName(name); // cxf conventionally keeps something in the name slot. }