public final PJsonArray toJSON ( ) { JSONArray jsonArray = new JSONArray ( ) ; final int size = this . array . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { final Object o = get ( i ) ; if ( o instanceof PYamlObject ) { PYamlObject pYamlObject = ( PYamlObject ) o ; jsonArray . put ( pYamlObject . toJSON ( ) . getInternalObj ( ) ) ; } else if ( o instanceof PYamlArray ) { PYamlArray pYamlArray = ( PYamlArray ) o ; jsonArray . put ( pYamlArray . toJSON ( ) . getInternalArray ( ) ) ; } else { jsonArray . put ( o ) ; } } return new PJsonArray ( null , jsonArray , getContextName ( ) ) ; }
Convert this object to a json array .