public class SFStringObject extends X3DConcreteField implements SFString
MFStringObject
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_VALUE
Default value for this field type is an empty String.
|
static java.lang.String |
DEFAULT_VALUE_STRING
Default string value for this field type is "".
|
static java.lang.String |
NAME
String constant NAME provides name of this element: SFString
|
static java.lang.String |
NameCharFilter
XML Regular Expression NameChar.
|
static java.lang.String |
NameFilter
XML Regular Expression NameFilter.
|
static java.lang.String |
NameStartCharFilter
XML Regular Expression NameStartChar.
|
static java.lang.String |
NmtokenFilter
XML Regular Expression Nmtoken.
|
static java.util.regex.Pattern |
PATTERN
Precompiled regular expression (regex) pattern for this field type using default REGEX value.
|
static java.lang.String |
REGEX
Default regular expression (regex) pattern for this field type is (\s|\S)*
|
static int |
TUPLE_SIZE
Default tuple size for this field type is 1 (i.e. number of component values making up a single-field SF object).
|
validationResult
Constructor and Description |
---|
SFStringObject()
Constructor for SFStringObject performs value initialization.
|
SFStringObject(SFStringObject newValue)
Constructor to copy an SFStringObject value as initial value for this new field object.
|
SFStringObject(java.lang.String newValue)
Constructor for SFStringObject using a corresponding Java primitive String as new initial value.
|
Modifier and Type | Method and Description |
---|---|
void |
appendValue(java.lang.String newValue)
Append an additional String to this field.
|
java.lang.String |
getPrimitiveValue()
Provides current value of the field as a Java primitive type.
|
java.lang.String |
getValue()
Get the current value.
|
void |
initialize()
Initialization for SFStringObject applies default initial value.
|
boolean |
isDefaultValue()
Determine whether current value matches DEFAULT_VALUE
|
static boolean |
isNMTOKEN(java.lang.String value)
Utility method to determine if string meets XML NMTOKEN requirements
|
boolean |
matches()
Test PATTERN match via regular expression (regex) check of current object's toString() value.
|
static boolean |
matches(java.lang.String value)
Test PATTERN match with regular expression (regex) of provided value.
|
static boolean |
meetsX3dInteroperabilityNamingConventions(java.lang.String value)
Utility method to determine if string meets suggested X3D naming conventions: starts with letter or underscore character, includes letter character numeral or underscore characters.
|
void |
prependValue(java.lang.String newValue)
Append an additional String to this field.
|
SFStringObject |
setValue(SFStringObject newValue)
Apply an SFStringObject value to this field.
|
void |
setValue(java.lang.String newValue)
Assign a new value to this field.
|
SFStringObject |
setValueByString(java.lang.String newValue)
Utility accessor for SFStringObject using String value
|
java.lang.String |
toString()
Provides current value as a String.
|
static java.lang.String |
toString(java.lang.String value)
Static utility method to provide String representation of a correctly typed input value.
|
java.lang.String |
toStringX3D()
Provide String representation of this object, properly escaped for XML-based X3D syntax and conforming to X3D Canonical Form.
|
static java.lang.String |
toStringX3D(java.lang.String value)
Static utility method to provide String representation of input String, properly escaped using XML-based X3D syntax.
|
java.lang.String |
validate()
Validate current value via regular expression (regex) check of current object's toString() value, reporting errors only if found.
|
addX3DEventListener, getDefinition, getTupleSize, getValidationResult, isReadable, isWritable, removeX3DEventListener, setReadable, setWritable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addX3DEventListener, getDefinition, isReadable, isWritable, removeX3DEventListener
public static final java.lang.String NAME
public static final java.lang.String DEFAULT_VALUE
public static final java.lang.String DEFAULT_VALUE_STRING
public static final int TUPLE_SIZE
public static final java.lang.String REGEX
public static final java.util.regex.Pattern PATTERN
REGEX
,
matches()
,
matches(String)
,
validate()
,
java.util.regex.Patternpublic static final java.lang.String NameStartCharFilter
public static final java.lang.String NameCharFilter
public static final java.lang.String NameFilter
public static final java.lang.String NmtokenFilter
public SFStringObject()
public SFStringObject(SFStringObject newValue)
newValue
- The newValue to applypublic SFStringObject(java.lang.String newValue)
newValue
- is new value to assign
setContainerFieldOverride(containerFieldName); // apply checksConcreteField#getTupleSize(String)public void initialize()
initialize
in class X3DConcreteField
DEFAULT_VALUE
public static final boolean isNMTOKEN(java.lang.String value)
value
- string to checkmeetsX3dInteroperabilityNamingConventions(String)
,
X3D Scene Authoring Hints: Naming Conventions,
X3D Tooltips: type NMTOKEN,
X3D Regular Expressions (regexes),
XML 1.0 Recommendation, 2.3 Common Syntactic Constructs,
XML 1.1 NMTOKEN,
Java Language Specification: 3 Lexical Structure, 3.2. Lexical Translations,
Java Tutorials: Unicode,
Java and Unicode: Supplementary Characters in the Java Platformpublic static final boolean meetsX3dInteroperabilityNamingConventions(java.lang.String value)
value
- string to checkisNMTOKEN(String)
,
X3D Scene Authoring Hints: Naming Conventions,
X3D Tooltips: type NMTOKEN,
X3D Regular Expressions (regexes),
XML 1.0 Recommendation, 2.3 Common Syntactic Constructs,
XML 1.1 NMTOKEN,
Java Language Specification: 3 Lexical Structure, 3.2. Lexical Translations,
Java Tutorials: Unicode,
Java and Unicode: Supplementary Characters in the Java Platformpublic void appendValue(java.lang.String newValue)
newValue
- The value to append.String.concat(String)
public void prependValue(java.lang.String newValue)
newValue
- The value to append.appendValue(String)
public final java.lang.String validate()
REGEX
,
PATTERN
,
matches()
,
matches(String)
,
validate()
,
java.util.regex.Patternpublic final boolean matches()
REGEX
,
PATTERN
,
matches()
,
matches(String)
,
validate()
,
java.util.regex.Patternpublic static final boolean matches(java.lang.String value)
value
- String to check against regex pattern for successful matchREGEX
,
PATTERN
,
matches()
,
matches(String)
,
validate()
,
java.util.regex.Patternpublic SFStringObject setValueByString(java.lang.String newValue) throws InvalidFieldValueException
newValue
- is new value to assignMFMatrix4dObject
- namely this same object to allow sequential method pipelining (i.e. consecutive
method invocations on the same node object).InvalidFieldValueException
public static java.lang.String toString(java.lang.String value)
value
- The value to convert to a StringtoStringX3D(java.lang.String)
,
MFStringObject.toStringX3D()
,
X3D Abstract Specification: 5.3.14 SFString and MFString,
X3D XML Encoding: 5.15 SFString and MFString,
X3D Tooltips: Text,
X3D Tooltips: typepublic static java.lang.String toStringX3D(java.lang.String value)
value
- The value to convert to an escaped StringtoStringX3D(java.lang.String)
,
MFStringObject.toStringX3D()
,
X3D Abstract Specification: 5.3.14 SFString and MFString,
X3D XML Encoding: 5.15 SFString and MFString,
X3D Tooltips: Text,
X3D Tooltips: typepublic java.lang.String toStringX3D()
toStringX3D(String)
,
MFStringObject.toStringX3D()
,
X3DObject.FILE_EXTENSION_X3D
,
X3DObject.FILE_EXTENSION_XML
,
X3D Tooltips: type SFString,
X3D XML Encoding,
X3D Compressed Binary Encoding: X3D Canonical Form,
X3D Canonicalization (C14N) Toolpublic java.lang.String getValue()
public java.lang.String getPrimitiveValue()
public java.lang.String toString()
toString
in class java.lang.Object
public void setValue(java.lang.String newValue)
setValue
in interface SFString
newValue
- The replacement value to assign.X3DConcreteField.getTupleSize(String)
public SFStringObject setValue(SFStringObject newValue)
newValue
- The newValue to applySFStringObject
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public boolean isDefaultValue()
DEFAULT_VALUE
Copyright ©2005-2017 Web3D Consortium under an open-source license, free for any use. Feedback is welcome.