public static MtasSpanQuery constructQuery(String queryValue,
      String queryType, String queryPrefix,
      HashMap<String, String[]> queryVariables, String field,
      String queryIgnore, Integer maximumIgnoreLength) throws IOException {
    if (queryType == null || queryType.isEmpty()) {
      throw new IOException("no (valid) type for query " + queryValue);
    } else if (queryValue == null || queryValue.isEmpty()) {
      throw new IOException("no (valid) value for " + queryType + " query");
    }
    MtasSpanQuery ignore = null;
    if (queryIgnore != null) {
      Reader queryIgnoreReader = new BufferedReader(
          new StringReader(queryIgnore));
      if (queryType.equals(QUERY_TYPE_CQL)) {
        MtasCQLParser ip = new MtasCQLParser(queryIgnoreReader);
        try {
          ignore = ip.parse(field, null, null, null, null);
        } catch (mtas.parser.cql.ParseException e) {
          throw new IOException("couldn't parse " + queryType + " query "
              + queryIgnore + " (" + e.getMessage() + ")", e);
        } catch (TokenMgrError e) {
          throw new IOException("couldn't parse " + queryType + " query "
              + queryIgnore + " (" + e.getMessage() + ")", e);
        }
      } else {
        throw new IOException(
            "unknown queryType " + queryType + " for query " + queryValue);
      }
    }
    Reader queryValueReader = new BufferedReader(new StringReader(queryValue));
    if (queryType.equals(QUERY_TYPE_CQL)) {
      MtasCQLParser qp = new MtasCQLParser(queryValueReader);
      try {
        return qp.parse(field, queryPrefix, queryVariables, ignore,
            maximumIgnoreLength);
      } catch (mtas.parser.cql.ParseException e) {
        throw new IOException("couldn't parse " + queryType + " query "
            + queryValue + " (" + e.getMessage() + ")", e);
      } catch (TokenMgrError e) {
        throw new IOException("couldn't parse " + queryType + " query "
            + queryValue + " (" + e.getMessage() + ")", e);
      }
    } else {
      throw new IOException(
          "unknown queryType " + queryType + " for query " + queryValue);
    }
  }
public static MtasSpanQuery constructQuery ( String queryValue , String queryType , String queryPrefix , HashMap < String , String [ ] > queryVariables , String field , String queryIgnore , Integer maximumIgnoreLength ) throws IOException { if ( queryType == null || queryType . isEmpty ( ) ) { throw new IOException ( "no (valid) type for query " + queryValue ) ; } else if ( queryValue == null || queryValue . isEmpty ( ) ) { throw new IOException ( "no (valid) value for " + queryType + " query" ) ; } MtasSpanQuery ignore = null ; if ( queryIgnore != null ) { Reader queryIgnoreReader = new BufferedReader ( new StringReader ( queryIgnore ) ) ; if ( queryType . equals ( QUERY_TYPE_CQL ) ) { MtasCQLParser ip = new MtasCQLParser ( queryIgnoreReader ) ; try { ignore = ip . parse ( field , null , null , null , null ) ; } catch ( mtas . parser . cql . ParseException e ) { throw new IOException ( "couldn't parse " + queryType + " query " + queryIgnore + " (" + e . getMessage ( ) + ")" , e ) ; } catch ( TokenMgrError e ) { throw new IOException ( "couldn't parse " + queryType + " query " + queryIgnore + " (" + e . getMessage ( ) + ")" , e ) ; } } else { throw new IOException ( "unknown queryType " + queryType + " for query " + queryValue ) ; } } Reader queryValueReader = new BufferedReader ( new StringReader ( queryValue ) ) ; if ( queryType . equals ( QUERY_TYPE_CQL ) ) { MtasCQLParser qp = new MtasCQLParser ( queryValueReader ) ; try { return qp . parse ( field , queryPrefix , queryVariables , ignore , maximumIgnoreLength ) ; } catch ( mtas . parser . cql . ParseException e ) { throw new IOException ( "couldn't parse " + queryType + " query " + queryValue + " (" + e . getMessage ( ) + ")" , e ) ; } catch ( TokenMgrError e ) { throw new IOException ( "couldn't parse " + queryType + " query " + queryValue + " (" + e . getMessage ( ) + ")" , e ) ; } } else { throw new IOException ( "unknown queryType " + queryType + " for query " + queryValue ) ; } }
Construct query.

@param queryValue the query value
@param queryType the query type
@param queryPrefix the query prefix
@param queryVariables the query variables
@param field the field
@param queryIgnore the query ignore
@param maximumIgnoreLength the maximum ignore length
@return the mtas span query
@throws IOException Signals that an I/O exception has occurred.