public class RegularExpressionDocument extends PlainDocument
RegularExpressionDocument can take any character that is specified in the given
regular expressionAbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElementlineLimitAttribute, tabSizeAttributeBAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementNameStreamDescriptionProperty, TitleProperty| Constructor and Description |
|---|
RegularExpressionDocument(@NonNull String regex)
Instantiates a new
RegularExpressionDocument object. |
| Modifier and Type | Method and Description |
|---|---|
void |
insertString(int offset,
String string,
AttributeSet attributes) |
void |
remove(int offset,
int length) |
String |
validate(String proposedValue)
Validate the given value by this
RegularExpressionDocument object |
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdateaddDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlockpublic RegularExpressionDocument(@NonNull
@NonNull String regex)
RegularExpressionDocument object.regex - the regular expressionpublic void insertString(int offset,
String string,
AttributeSet attributes)
throws BadLocationException
insertString in interface DocumentinsertString in class PlainDocumentBadLocationExceptionpublic void remove(int offset,
int length)
throws BadLocationException
remove in interface Documentremove in class AbstractDocumentBadLocationExceptionpublic String validate(String proposedValue) throws IllegalArgumentException
RegularExpressionDocument objectproposedValue - the proposed valueIllegalArgumentException - if the validation failsCopyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.