congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
PropertyIsLike
Code IndexAdd Tabnine to your IDE (free)

How to use
PropertyIsLike
in
org.deegree.filter.comparison

Best Java code snippets using org.deegree.filter.comparison.PropertyIsLike (Showing top 13 results out of 315)

origin: deegree/deegree3

private static void export( PropertyIsLike operator, XMLStreamWriter writer )
            throws XMLStreamException {
  writer.writeStartElement( FES_20_NS, "PropertyIsLike" );
  writer.writeAttribute( "wildCard", operator.getWildCard() );
  writer.writeAttribute( "singleChar", operator.getSingleChar() );
  writer.writeAttribute( "escapeChar", operator.getEscapeChar() );
  export( operator.getExpression(), writer );
  export( operator.getPattern(), writer );
  writer.writeEndElement();
}
origin: deegree/deegree3

case PROPERTY_IS_LIKE:
  PropertyIsLike pil = (PropertyIsLike) op;
  return new PropertyIsLike( copy( pil.getExpression() ), copyExpression( pil.getPattern(), values ),
                pil.getWildCard(), pil.getSingleChar(), pil.getEscapeChar(),
                pil.isMatchCase(), pil.getMatchAction() );
case PROPERTY_IS_NOT_EQUAL_TO:
  PropertyIsNotEqualTo pine = (PropertyIsNotEqualTo) op;
origin: deegree/deegree3

case PROPERTY_IS_LIKE:
  PropertyIsLike pil = (PropertyIsLike) o;
  return new PropertyIsLike( exs[0], exs[1], pil.getWildCard(), pil.getSingleChar(), pil.getEscapeChar(),
                o.isMatchCase(), o.getMatchAction() );
case PROPERTY_IS_NIL:
origin: deegree/deegree3

private static PropertyIsLike parsePropertyIsLikeOperator( XMLStreamReader xmlStream )
            throws XMLStreamException {
  // this is a deegree extension over Filter 1.1.0 spec.
  boolean matchCase = getAttributeValueAsBoolean( xmlStream, null, "matchCase", true );
  String wildCard = getRequiredAttributeValue( xmlStream, "wildCard" );
  String singleChar = getRequiredAttributeValue( xmlStream, "singleChar" );
  String escapeChar = getRequiredAttributeValue( xmlStream, "escapeChar" );
  nextElement( xmlStream );
  ValueReference propName = parsePropertyName( xmlStream, false );
  nextElement( xmlStream );
  if ( !"Literal".equals( xmlStream.getLocalName() ) ) {
    String message = "FilterEncoding 1.1.0 does not allow other than Literal elements as second expression in PropertyIsLike filters!";
    throw new XMLStreamException( message );
  }
  Literal<?> literal = parseLiteral( xmlStream );
  nextElement( xmlStream );
  return new PropertyIsLike( propName, literal, wildCard, singleChar, escapeChar, matchCase, null );
}
origin: deegree/deegree3

/**
 * Translates the given {@link PropertyIsLike} into an {@link SQLOperation}.
 * <p>
 * NOTE: This method appends the generated argument inline, i.e. not using a <code>?</code>. This is because of a
 * problem that has been observed with PostgreSQL 8.0; the execution of the inline version is *much* faster.
 * </p>
 * 
 * @param op
 *            comparison operator to be translated, must not be <code>null</code>
 * @return corresponding SQL expression, never <code>null</code>
 * @throws UnmappableException
 *             if translation is not possible (usually due to unmappable property names)
 * @throws FilterEvaluationException
 *             if the expression contains invalid {@link ValueReference}s
 */
@Override
protected SQLOperation toProtoSQL( PropertyIsLike op )
            throws UnmappableException, FilterEvaluationException {
  Expression pattern = op.getPattern();
  if ( pattern instanceof Literal ) {
    String literal = ( (Literal<?>) pattern ).getValue().toString();
    return toProtoSql( op, literal );
  } else if ( pattern instanceof Function ) {
    String valueAsString = getStringValueFromFunction( pattern );
    return toProtoSql( op, valueAsString );
  }
  String msg = "Mapping of PropertyIsLike with non-literal or non-function comparisons to SQL is not implemented yet.";
  throw new UnsupportedOperationException( msg );
}
origin: deegree/deegree3

private SQLOperation getOperationFromBuilder( PropertyIsLike op, SQLExpression propName, String sqlEncoded ) {
  SQLOperationBuilder builder = new SQLOperationBuilder();
  if ( !op.isMatchCase() ) {
    builder.add( "LOWER(" );
  }
  builder.add( propName );
  if ( op.isMatchCase() ) {
    builder.add( "::TEXT LIKE '" );
  } else {
    builder.add( "::TEXT) LIKE '" );
  }
  builder.add( sqlEncoded );
  builder.add( "'" );
  return builder.toOperation();
}
origin: deegree/deegree3

private PropertyIsLike buildIsLike( Expression propName, Expression literal, boolean matchCase )
            throws UnmappableException {
  if ( !( propName instanceof ValueReference ) || !( literal instanceof Literal ) ) {
    String msg = "Can not map filter. Multi-valued columns can only be compared to literals.";
    throw new UnmappableException( msg );
  }
  String wildCard = "*";
  String singleChar = "?";
  String escapeChar = "\\";
  String s = ( (Literal<?>) literal ).getValue().toString();
  s = StringUtils.replaceAll( s, escapeChar, escapeChar + escapeChar );
  s = StringUtils.replaceAll( s, singleChar, escapeChar + singleChar );
  s = StringUtils.replaceAll( s, wildCard, escapeChar + wildCard );
  Literal<PrimitiveValue> escapedLiteral = new Literal<PrimitiveValue>( new PrimitiveValue( s ), null );
  return new PropertyIsLike( (ValueReference) propName, escapedLiteral, wildCard, singleChar, escapeChar,
                matchCase, null );
}
origin: deegree/deegree3

private SQLOperation toProtoSql( PropertyIsLike op, String literal )
            throws UnmappableException, FilterEvaluationException {
  String escape = "" + op.getEscapeChar();
  String wildCard = "" + op.getWildCard();
  String singleChar = "" + op.getSingleChar();
  SQLExpression propName = toProtoSQL( op.getExpression() );
  IsLikeString specialString = new IsLikeString( literal, wildCard, singleChar, escape );
  String sqlEncoded = specialString.toSQL( !op.isMatchCase() );
  if ( propName.isMultiValued() ) {
    // TODO escaping of pipe symbols
    sqlEncoded = "%|" + sqlEncoded + "|%";
  }
  return getOperationFromBuilder( op, propName, sqlEncoded );
}
origin: deegree/deegree3

private static PropertyIsLike parsePropertyIsLikeOperator( XMLStreamReader xmlStream )
            throws XMLStreamException {
  // this is a deegree extension over Filter 1.0.0
  boolean matchCase = getAttributeValueAsBoolean( xmlStream, null, "matchCase", true );
  String wildCard = getRequiredAttributeValue( xmlStream, "wildCard" );
  String singleChar = getRequiredAttributeValue( xmlStream, "singleChar" );
  String escapeChar = getRequiredAttributeValue( xmlStream, "escape" );
  nextElement( xmlStream );
  ValueReference propName = parsePropertyName( xmlStream );
  nextElement( xmlStream );
  Literal<?> literal = parseLiteral( xmlStream );
  nextElement( xmlStream );
  return new PropertyIsLike( propName, literal, wildCard, singleChar, escapeChar, matchCase, null );
}
origin: deegree/deegree3

          throws UnmappableException, FilterEvaluationException {
if ( !( op.getPattern() instanceof Literal ) ) {
  String msg = "Mapping of PropertyIsLike with non-literal comparisons to SQL is not implemented yet.";
  throw new UnsupportedOperationException( msg );
String literal = ( (Literal) op.getPattern() ).getValue().toString();
String escape = "" + op.getEscapeChar();
String wildCard = "" + op.getWildCard();
String singleChar = "" + op.getSingleChar();
SQLExpression propName = toProtoSQL( op.getExpression() );
String sqlEncoded = specialString.toSQL( !op.isMatchCase() );
if ( !op.isMatchCase() ) {
  builder.add( "LOWER (" + propName + ")" );
} else {
origin: deegree/deegree3

private static PropertyIsLike parsePropertyIsLikeOperator( XMLStreamReader xmlStream )
            throws XMLStreamException {
  // this is a deegree extension over Filter 2.0.0 spec. (TODO should this be null, if not present?)
  Boolean matchCase = getAttributeValueAsBoolean( xmlStream, null, "matchCase", true );
  // this is a deegree extension over Filter 2.0.0 spec. (TODO should this be null, if not present?)
  MatchAction matchAction = null;
  String s = XMLStreamUtils.getAttributeValue( xmlStream, "matchAction" );
  if ( s != null ) {
    matchAction = parseMatchAction( xmlStream, s );
  }
  String wildCard = getRequiredAttributeValue( xmlStream, "wildCard" );
  String singleChar = getRequiredAttributeValue( xmlStream, "singleChar" );
  String escapeChar = getRequiredAttributeValue( xmlStream, "escapeChar" );
  nextElement( xmlStream );
  Expression value = parseExpression( xmlStream );
  nextElement( xmlStream );
  Expression pattern = parseExpression( xmlStream );
  nextElement( xmlStream );
  return new PropertyIsLike( value, pattern, wildCard, singleChar, escapeChar, matchCase, matchAction );
}
origin: deegree/deegree3

          throws UnmappableException, FilterEvaluationException {
if ( !( op.getPattern() instanceof Literal ) ) {
  String msg = "Mapping of PropertyIsLike with non-literal comparisons to SQL is not implemented yet.";
  throw new UnsupportedOperationException( msg );
String literal = ( (Literal) op.getPattern() ).getValue().toString();
String escape = "" + op.getEscapeChar();
String wildCard = "" + op.getWildCard();
String singleChar = "" + op.getSingleChar();
SQLExpression propName = toProtoSQL( op.getExpression() );
String sqlEncoded = specialString.toSQL( !op.isMatchCase() );
if ( !op.isMatchCase() ) {
  builder.add( "LOWER (" + propName + ")" );
} else {
origin: deegree/deegree3

case PROPERTY_IS_LIKE:
  PropertyIsLike isLikeOperator = (PropertyIsLike) operator;
  writer.writeAttribute( "wildCard", isLikeOperator.getWildCard() );
  writer.writeAttribute( "singleChar", isLikeOperator.getSingleChar() );
  writer.writeAttribute( "escapeChar", isLikeOperator.getEscapeChar() );
  if ( isLikeOperator.isMatchCase() != null ) {
    writer.writeAttribute( "matchCase", "" + isLikeOperator.isMatchCase() );
  export( isLikeOperator.getExpression(), writer );
  export( isLikeOperator.getPattern(), writer );
  break;
case PROPERTY_IS_NOT_EQUAL_TO:
org.deegree.filter.comparisonPropertyIsLike

Javadoc

TODO add documentation here

Most used methods

  • getEscapeChar
  • getExpression
  • getPattern
  • getSingleChar
  • getWildCard
  • isMatchCase
  • <init>
  • getMatchAction
  • getPrimitiveValues
  • matches
    Checks if a given String matches a pattern that is a sequence of: * standard characters * wildca

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now