Class SFString
java.lang.Object
org.web3d.x3d.jsail.fields.X3DConcreteField
org.web3d.x3d.jsail.fields.SFString
This utility class provides a concrete implementation corresponding to SFString X3D field type.
Package hint: This specification class is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI). SFString defines a single string encoded with the UTF-8 universal character set.
Related field object:
Package hint: This specification class is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI). SFString defines a single string encoded with the UTF-8 universal character set.
Related field object:
MFString- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault value for this field type is an empty String.static final StringDefault string value for this field type is "".static final StringString constant NAME provides name of this element: SFStringstatic final StringXML Regular Expression NameChar.static final StringXML Regular Expression NameFilter.static final StringXML Regular Expression NameStartChar.static final StringXML Regular Expression Nmtoken.static final PatternPrecompiled regular expression (regex) pattern for this field type using default REGEX value.static final StringDefault regular expression (regex) pattern for this field type is (\s|\S)*static final intDefault tuple size for this field type is 1 (i.e. number of component values making up a single-field SF object).Fields inherited from class org.web3d.x3d.jsail.fields.X3DConcreteField
validationResult -
Constructor Summary
ConstructorsConstructorDescriptionSFString()Constructor for SFString performs value initialization.Constructor for SFString using a corresponding Java primitive String as new initial value.Constructor to copy an SFString value as initial value for this new field object. -
Method Summary
Modifier and TypeMethodDescriptionvoidappendValue(String newValue) Append an additional String to this field.booleanDetermine whether current SFString object and String contain equal values.booleanDetermine whether current object and another SFString object contain equal values.Provides current value of the field as a Java primitive type.getValue()Get the current value.final voidInitialization for SFString applies default initial value.static final booleanisArray()Whether or not this field type is an array (false)booleanDetermine whether current value matches DEFAULT_VALUEstatic final booleanUtility method to determine if string meets XML NMTOKEN requirementsstatic booleanisX3dNodeName(String value) Case-insensitive test whether or not string is a reserved X3D node name.static booleanisX3dStatementName(String value) Case-insensitive test whether or not string is a reserved X3D statement name.final booleanmatches()Test PATTERN match via regular expression (regex) check of current object's toString() value.static final booleanTest PATTERN match with regular expression (regex) of provided value.static final booleanUtility method to determine if string meets suggested X3D naming conventions: starts with letter or underscore character, includes letter character numeral or underscore characters.voidprependValue(String newValue) Prepend an additional String to this field.voidAssign a new value to this field.Apply an SFString value to this field.setValueByString(String newValue) Utility accessor for SFString using String valuetoString()Provides current value as a String.static StringStatic utility method to provide String representation of a correctly typed input value.Provide String representation of this SFString object, properly escaped using ClassicVRML (.x3dv) or VRML97 (.wrl) syntax.static StringtoStringClassicVRML(String value) Static utility method to provide SFString representation of input String, properly escaped using ClassicVRML (.x3dv) or VRML97 (.wrl) syntax.Provide String representation of this SFString object, properly escaped for XML-based X3D syntax and conforming to X3D Canonical Form.static StringtoStringX3D(String value) Static utility method to provide String representation of input String, properly escaped using XML-based X3D syntax.final Stringvalidate()Validate current value via regular expression (regex) check of current object's toString() value, reporting errors only if found.final StringValidate current value via regular expression (regex) check of current object's toString() value, reporting errors only if found.Methods inherited from class org.web3d.x3d.jsail.fields.X3DConcreteField
addX3DEventListener, getDefinition, getTupleSize, getValidationResult, isReadable, isWritable, removeX3DEventListener, setReadable, setWritable
-
Field Details
-
NAME
String constant NAME provides name of this element: SFString- See Also:
-
DEFAULT_VALUE
Default value for this field type is an empty String.- See Also:
-
DEFAULT_VALUE_STRING
Default string value for this field type is "".- See Also:
-
TUPLE_SIZE
public static final int TUPLE_SIZEDefault tuple size for this field type is 1 (i.e. number of component values making up a single-field SF object).- See Also:
-
REGEX
Default regular expression (regex) pattern for this field type is (\s|\S)*- See Also:
-
PATTERN
Precompiled regular expression (regex) pattern for this field type using default REGEX value.- See Also:
-
NameStartCharFilter
XML Regular Expression NameStartChar. TODO integrate special-character support into regex. [4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]- See Also:
-
NameCharFilter
XML Regular Expression NameChar. TODO integrate special-character support into regex. [4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]- See Also:
-
NameFilter
XML Regular Expression NameFilter. TODO integrate special-character support into regex. [5] Name ::= NameStartChar (NameChar)*- See Also:
-
NmtokenFilter
XML Regular Expression Nmtoken. TODO integrate special-character support into regex. [7] Nmtoken ::= (NameChar)+- See Also:
-
-
Constructor Details
-
SFString
public SFString()Constructor for SFString performs value initialization. -
SFString
Constructor to copy an SFString value as initial value for this new field object.- Parameters:
newValue- The newValue to apply
-
SFString
Constructor for SFString using a corresponding Java primitive String as new initial value.- Parameters:
newValue- is new value to assign setContainerFieldOverride(containerFieldName); // apply checksConcreteField#getTupleSize(String)
-
-
Method Details
-
isArray
public static final boolean isArray()Whether or not this field type is an array (false)- Returns:
- true if array type
-
initialize
public final void initialize()Initialization for SFString applies default initial value. Static initializer also provided to verify that the regex pattern compiles and matches that default value.- Specified by:
initializein classX3DConcreteField- See Also:
-
isNMTOKEN
Utility method to determine if string meets XML NMTOKEN requirements- Parameters:
value- string to check- Returns:
- whether value meets NMTOKEN regex checks
- See Also:
-
meetsX3dInteroperabilityNamingConventions
Utility method to determine if string meets suggested X3D naming conventions: starts with letter or underscore character, includes letter character numeral or underscore characters. Avoids whitespace, apostrophe, hyphen, minus, comma, period or other special characters in order to ensure portability- Parameters:
value- string to check- Returns:
- whether value meets suggested X3D naming requirements
- See Also:
-
isX3dNodeName
Case-insensitive test whether or not string is a reserved X3D node name.- Parameters:
value- to check- Returns:
- whether value is a reserved X3D node name
-
isX3dStatementName
Case-insensitive test whether or not string is a reserved X3D statement name.- Parameters:
value- to check- Returns:
- whether value is a reserved X3D node name
-
appendValue
Append an additional String to this field.- Parameters:
newValue- The value to append.- See Also:
-
prependValue
Prepend an additional String to this field.- Parameters:
newValue- The value to prepend.- See Also:
-
equals
Determine whether current object and another SFString object contain equal values.- Parameters:
comparisonSFString- field type to compare- Returns:
- true if equivalent, false otherwise
-
equals
Determine whether current SFString object and String contain equal values.- Parameters:
comparisonValue- String[] array to compare- Returns:
- true if equivalent, false otherwise
-
validate
Validate current value via regular expression (regex) check of current object's toString() value, reporting errors only if found.- Returns:
- empty string if PATTERN matches, warning otherwise
- See Also:
-
validateRegex
Validate current value via regular expression (regex) check of current object's toString() value, reporting errors only if found.- Returns:
- empty string if PATTERN matches, warning otherwise
- See Also:
-
matches
public final boolean matches()Test PATTERN match via regular expression (regex) check of current object's toString() value.- Returns:
- true if PATTERN matches, false otherwise
- See Also:
-
matches
Test PATTERN match with regular expression (regex) of provided value.- Parameters:
value- String to check against regex pattern for successful match- Returns:
- true if PATTERN matches, false otherwise
- See Also:
-
setValueByString
Utility accessor for SFString using String value- Parameters:
newValue- is new value to assign- Returns:
MFMatrix4d- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same node object).- Throws:
InvalidFieldValueException
-
toString
-
toStringX3D
-
toStringClassicVRML
Static utility method to provide SFString representation of input String, properly escaped using ClassicVRML (.x3dv) or VRML97 (.wrl) syntax.- Parameters:
value- The value to convert to an escaped String- Returns:
- ClassicVRML/VRML97-escaped String version of the provided value
- See Also:
-
toStringX3D
Provide String representation of this SFString object, properly escaped for XML-based X3D syntax and conforming to X3D Canonical Form.- Returns:
- XML/X3D-escaped version of this SFString
- See Also:
-
toStringClassicVRML
Provide String representation of this SFString object, properly escaped using ClassicVRML (.x3dv) or VRML97 (.wrl) syntax.- Returns:
- ClassicVRML/VRML97-escaped version of this SFString
- See Also:
-
getValue
-
getPrimitiveValue
Provides current value of the field as a Java primitive type.- Returns:
- current value
-
toString
-
setValue
-
setValue
-
isDefaultValue
public boolean isDefaultValue()Determine whether current value matches DEFAULT_VALUE- Returns:
- whether current value matches DEFAULT_VALUE
- See Also:
-