/** * {@inheritDoc} * * @see BaseElement#setName(String) * @since 2.2.3 */ @Override public void setName(String name) { super.setName(name); // We force to refresh the XClass reference so that next time it's retrieved again it'll be resolved against // the new document reference. this.xClassReferenceCache = null; } }
/** * {@inheritDoc} * * @see java.lang.Object#clone() */ @Override public Object clone() { BaseElement element; try { element = getClass().newInstance(); // Make sure we clone either the reference or the name depending on which one is used. if (this.reference != null) { element.setDocumentReference(getDocumentReference()); } else if (this.name != null) { element.setName(getName()); } element.setPrettyName(getPrettyName()); } catch (Exception e) { // This should not happen element = null; } return element; } }