[#7279] Add RenderKeywordStyle.PASCAL

This commit is contained in:
lukaseder 2018-03-12 10:46:14 +01:00
parent d57f016144
commit 01ea7e961c
3 changed files with 13 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import javax.xml.bind.annotation.XmlType;
* <enumeration value="AS_IS"/>
* <enumeration value="LOWER"/>
* <enumeration value="UPPER"/>
* <enumeration value="PASCAL"/>
* </restriction>
* </simpleType>
* </pre>
@ -34,7 +35,8 @@ public enum RenderKeywordStyle {
AS_IS,
LOWER,
UPPER;
UPPER,
PASCAL;
public String value() {
return name();

View File

@ -57,11 +57,15 @@ public class KeywordImpl extends AbstractQueryPart implements Keyword {
private final String asIs;
private final String upper;
private final String lower;
private final String pascal;
KeywordImpl(String keyword) {
this.asIs = keyword;
this.upper = keyword.toUpperCase();
this.lower = keyword.toLowerCase();
this.pascal = keyword.length() > 0
? keyword.substring(0, 1).toUpperCase() + keyword.substring(1, keyword.length()).toLowerCase()
: keyword;
}
@Override
@ -72,6 +76,8 @@ public class KeywordImpl extends AbstractQueryPart implements Keyword {
ctx.sql(asIs, true);
else if (RenderKeywordStyle.UPPER == style)
ctx.sql(upper, true);
else if (RenderKeywordStyle.PASCAL == style)
ctx.sql(pascal, true);
else
ctx.sql(lower, true);
}

View File

@ -377,6 +377,10 @@ Either &lt;input/> or &lt;inputExpression/> must be provided]]></jxb:javadoc></j
<!-- Keywords are rendered in upper case. For instance:
SELECT .. FROM .. WHERE .. -->
<enumeration value="UPPER"/>
<!-- Keywords are rendered in Pascal Case. For instance:
Select .. From .. Where .. -->
<enumeration value="PASCAL"/>
</restriction>
</simpleType>