[x3d-public] X3DJSAIL. Handling of MFStrings. using string constants, setting an array value with brackets?

Don Brutzman brutzman at nps.edu
Sat Feb 25 22:57:16 PST 2017


MFStringObject now includes some additional static convenience methodsfor enumeration handling.

==============================
MFStringObject.cleanupEnumerationValues(String values)
Utility method for enumeration values to ignore all whitespace, remove all embedded quotes, remove all commas, remove all square brackets, and create unadorned MFString elements as a String[] array.
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/fields/MFStringObject.html#cleanupEnumerationValues-java.lang.String-

==============================
MFStringObject.stripEnclosingQuotes(String singleValue) for enumeration handling.
Utility method to trim enclosing quotes and whitespace from a simple String.
WARNING: do not use this method on a String that contains multiple quoted values, use cleanupEnumerationValues() instead.
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/fields/MFStringObject.html#stripEnclosingQuotes-java.lang.String-

==============================

These can be applied by users as appropriate when creating MFString field values.  Hopefully no extra work is needed since they have been integrated when loading fields that have string enumerations. such as FontStyleObject.setJustify() etc.

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list