File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424
2525public class Constants {
2626
27- public static final String VERSION = "3.0 .0" ;
28- public static final String BUILD = "20251014_1235 " ;
27+ public static final String VERSION = "3.1 .0" ;
28+ public static final String BUILD = "20251014_2111 " ;
2929
3030 private Constants () {
3131 // private for security
Original file line number Diff line number Diff line change @@ -187,13 +187,39 @@ else if (c == ')')
187187
188188 @ Override
189189 public String toString () {
190+ if (type .equals (EMPTY )) {
191+ return EMPTY ;
192+ }
193+ if (type .equals (ANY )) {
194+ return ANY ;
195+ }
196+ if (content .isEmpty ()) {
197+ return "" ;
198+ }
199+
190200 StringBuilder sb = new StringBuilder ();
191- String separator = type .equals ("|" ) ? "|" : "," ;
201+
202+ // For MIXED content, handle specially
203+ if (type .equals (MIXED )) {
204+ sb .append ("(" );
205+ for (int i = 0 ; i < content .size (); i ++) {
206+ ContentParticle particle = content .get (i );
207+ sb .append (particle .toString ());
208+ if (i < content .size () - 1 ) {
209+ sb .append ("|" );
210+ }
211+ }
212+ sb .append (")*" );
213+ return sb .toString ();
214+ }
215+
216+ // For CHILDREN content, the particles themselves determine the structure
192217 for (int i = 0 ; i < content .size (); i ++) {
193218 ContentParticle particle = content .get (i );
194219 sb .append (particle .toString ());
195220 if (i < content .size () - 1 ) {
196- sb .append (separator );
221+ // This should not happen as CHILDREN content typically has a single root particle
222+ sb .append ("," );
197223 }
198224 }
199225 return sb .toString ();
You can’t perform that action at this time.
0 commit comments