private ArrayList < Property > parseProperties ( String contents ) { ArrayList < String > parts = new ArrayList <> ( ) ; boolean bInsideString = false , bInsideURL = false ; int j = 0 ; String substr ; for ( int i = 0 ; i < contents . length ( ) ; i ++ ) { if ( bInsideString ) { // If we're inside a string bInsideString = ! ( contents . charAt ( i ) == ' ' ) ; } else if ( bInsideURL ) { // If we're inside a URL bInsideURL = ! ( contents . charAt ( i ) == ' ' ) ; } else if ( contents . charAt ( i ) == ' ' ) { bInsideString = true ; } else if ( contents . charAt ( i ) == ' ' ) { if ( ( i - 3 ) > 0 && "url" . equals ( contents . substring ( i - 3 , i ) ) ) { bInsideURL = true ; } } else if ( contents . charAt ( i ) == ' ' ) { substr = contents . substring ( j , i ) ; if ( ! ( substr . trim ( ) . equals ( "" ) ) ) { parts . add ( substr ) ; } j = i + 1 ; } } substr = contents . substring ( j , contents . length ( ) ) ; if ( ! ( substr . trim ( ) . equals ( "" ) ) ) { parts . add ( substr ) ; } ArrayList < Property > results = new ArrayList <> ( ) ; for ( String part : parts ) { try { results . add ( new Property ( part ) ) ; } catch ( IncompletePropertyException ipex ) { LOG . warning ( "Incomplete property in selector \"" + this . selector + "\": \"" + ipex . getMessage ( ) + "\"" ) ; } } return results ; }
Parses out the properties of a selector s body .