J
Jacques Vidal
Question:
If you apply the "MM/dd/yyyy" pattern to, eg, a SimpleDateFormat
instance, isn't there a standard way to query this instance to
retrieve an array or Collection of its atomic elements? In this case,
{ "MM", "/", "dd", "/", "yyyy" }? Or even just the formatting
elements, { "MM", "dd", "yyyy" }?
I'd thought this feature would be available, anyway so far the only
thing I've seen that could help splitting the pattern string into
elements is the data stored in the runStarts field of the
AttributedString class - if you create an instance of this class using
formatToCharacterIterator() on yout SimpleDateFormat instance -, but
it turns out this field isn't visible outside of its enclosing
package.
Is there a way I've missed to get what I want? I just can't believe
I'll have to code a dedicated parser to do that.
If you apply the "MM/dd/yyyy" pattern to, eg, a SimpleDateFormat
instance, isn't there a standard way to query this instance to
retrieve an array or Collection of its atomic elements? In this case,
{ "MM", "/", "dd", "/", "yyyy" }? Or even just the formatting
elements, { "MM", "dd", "yyyy" }?
I'd thought this feature would be available, anyway so far the only
thing I've seen that could help splitting the pattern string into
elements is the data stored in the runStarts field of the
AttributedString class - if you create an instance of this class using
formatToCharacterIterator() on yout SimpleDateFormat instance -, but
it turns out this field isn't visible outside of its enclosing
package.
Is there a way I've missed to get what I want? I just can't believe
I'll have to code a dedicated parser to do that.