com.wewebu.ow.csqlc.ast
Class OwCharacterStringLiteral

java.lang.Object
  extended by com.wewebu.ow.csqlc.ast.OwCharacterStringLiteral
All Implemented Interfaces:
OwLiteral

public class OwCharacterStringLiteral
extends Object
implements OwLiteral

SQL AST node : <character string literal> syntax terminal as defined by the SQL grammar.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
3.2.0.0

Constructor Summary
OwCharacterStringLiteral(String characterString_p)
          Constructor
 
Method Summary
 OwCharacterStringLiteral append(String characterString_p)
          Appends the specified string to this character sequence String contents and returns new OwCharacterStringLiteral based on the resulted string literal contents.
 boolean contains(char c_p, boolean escaped_p)
          Search the given character in the contents of this String literal.
 StringBuilder createLiteralSQLString()
           
 OwCharacterStringLiteral insert(int offset_p, String characterString_p)
          Inserts the specified string at the given offset into this character sequence String contents and returns new OwCharacterStringLiteral based on the resulted string literal contents.
 boolean isNull()
           
 OwCharacterStringLiteral replace(int start_p, int end_p, String characterString_p)
          Replaces the specified range from this character sequence String contents with the specified String and returns new OwCharacterStringLiteral based on the resulted string literal contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwCharacterStringLiteral

public OwCharacterStringLiteral(String characterString_p)
Constructor

Parameters:
characterString_p - the String value of this literal , can be null
Method Detail

createLiteralSQLString

public StringBuilder createLiteralSQLString()
Specified by:
createLiteralSQLString in interface OwLiteral
Returns:
a StringBuilder filled with the string representation of this terminal

append

public OwCharacterStringLiteral append(String characterString_p)
Appends the specified string to this character sequence String contents and returns new OwCharacterStringLiteral based on the resulted string literal contents. Does not change this character string literal.

Parameters:
characterString_p -
Returns:
a new OwCharacterStringLiteral having its content formed by appending the given String to the contents of this literal
Since:
3.2.0.0

insert

public OwCharacterStringLiteral insert(int offset_p,
                                       String characterString_p)
Inserts the specified string at the given offset into this character sequence String contents and returns new OwCharacterStringLiteral based on the resulted string literal contents. Does not change this character string literal.

Parameters:
characterString_p -
Returns:
a new OwCharacterStringLiteral having its content formed by inserting the given String at the given offset into the contents of this literal
Throws:
StringIndexOutOfBoundsException - if the offset is invalid
Since:
3.2.0.0

replace

public OwCharacterStringLiteral replace(int start_p,
                                        int end_p,
                                        String characterString_p)
Replaces the specified range from this character sequence String contents with the specified String and returns new OwCharacterStringLiteral based on the resulted string literal contents. Does not change this character string literal.

Parameters:
characterString_p -
Returns:
a new OwCharacterStringLiteral having its content formed by replacing the specified range from this character sequence String contents with the given character String
Throws:
StringIndexOutOfBoundsException - if start is negative, greater than the length of the contents of this literal, or greater than end.
Since:
3.2.0.0

contains

public boolean contains(char c_p,
                        boolean escaped_p)
Search the given character in the contents of this String literal.

Parameters:
c_p -
escaped_p - if true only escaped occurrences of the given character are searched The backslash character (\) will be used to escape characters within quoted strings in the query as follows:
1. \' will represent a single-quote(') character
2. \ \ will represent a backslash (\) character
3. Within a LIKE string, \% and \_ will represent the literal characters % and _, respectively.
4. Although other instances of a \ are errors they are still considered valid by this method
Returns:
true if the given character is found considering escaping false otherwise
Since:
3.2.0.0

isNull

public boolean isNull()
Specified by:
isNull in interface OwLiteral
Returns:
true if the String value of this literal is null
false otherwise


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.