/** * Notification that the content of the document has changed. Causes the content * string and bytes to be cleared. */ public void documentChanged() { if (document != null) { content = null; contentSource = null; contentBytes = null; incrementNumChanges(); } }
/** * Notification that the content of the document has changed. Causes the content * string and bytes to be cleared. */ public void documentChanged() { if (document != null) { content = null; contentSource = null; contentBytes = null; incrementNumChanges(); } }
/** * Notification that the content of the document has changed. Causes the content * string and bytes to be cleared. */ public void documentChanged() { if (document != null) { content = null; contentSource = null; contentBytes = null; incrementNumChanges(); } }
/** * Sets the object's content as a raw String. Note, this operation * may clear the document if the content has changed * @param newContent New content. */ public void setContent(String newContent) { // TODO - Equality check may be unnecessary overhead if (content == null || !content.equals(newContent)) { content = newContent; document = null; contentSource = null; contentBytes = null; incrementNumChanges(); } }
/** * Sets the object's content as a raw String. Note, this operation * may clear the document if the content has changed * @param newContent New content. */ public void setContent(String newContent) { // TODO - Equality check may be unnecessary overhead if (content == null || !content.equals(newContent)) { content = newContent; document = null; contentSource = null; contentBytes = null; incrementNumChanges(); } }
/** * Sets the object's content as a raw String. Note, this operation * may clear the document if the content has changed * @param newContent New content. */ public void setContent(String newContent) { // TODO - Equality check may be unnecessary overhead if (content == null || !content.equals(newContent)) { content = newContent; document = null; contentSource = null; contentBytes = null; incrementNumChanges(); } }
/** * Sets the object's contentBytes as the given raw input. If ever interpreted * as a String, the data will be decoded as the encoding specified. * Note, this operation may clear the document if the content has changed. * Also note, it's mandated that the new bytes array will NOT be modified * by the caller of this API. The array is not copied, for performance reasons. * If the caller may modify a byte array, it MUST pass in a new copy. * @param newBytes New content. */ public void setContentBytes(byte[] newBytes, Charset newEncoding) { if (contentBytes == null || !Arrays.equals(contentBytes, newBytes)) { setContentBytesState(newBytes, newEncoding); document = null; contentSource = null; content = null; incrementNumChanges(); } }
/** * Sets the object's contentBytes as the given raw input. If ever interpreted * as a String, the data will be decoded as the encoding specified. * Note, this operation may clear the document if the content has changed. * Also note, it's mandated that the new bytes array will NOT be modified * by the caller of this API. The array is not copied, for performance reasons. * If the caller may modify a byte array, it MUST pass in a new copy. * @param newBytes New content. */ public void setContentBytes(byte[] newBytes, Charset newEncoding) { if (contentBytes == null || !Arrays.equals(contentBytes, newBytes)) { setContentBytesState(newBytes, newEncoding); document = null; contentSource = null; content = null; incrementNumChanges(); } }
/** * Sets the object's contentBytes as the given raw input. If ever interpreted * as a String, the data will be decoded as the encoding specified. * Note, this operation may clear the document if the content has changed. * Also note, it's mandated that the new bytes array will NOT be modified * by the caller of this API. The array is not copied, for performance reasons. * If the caller may modify a byte array, it MUST pass in a new copy. * @param newBytes New content. */ public void setContentBytes(byte[] newBytes, Charset newEncoding) { if (contentBytes == null || !Arrays.equals(contentBytes, newBytes)) { setContentBytesState(newBytes, newEncoding); document = null; contentSource = null; content = null; incrementNumChanges(); } }