Skip to content

Instantly share code, notes, and snippets.

@h2000
Created December 17, 2014 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h2000/dcb3a1bbeca7314ab517 to your computer and use it in GitHub Desktop.
Save h2000/dcb3a1bbeca7314ab517 to your computer and use it in GitHub Desktop.
Changed getter name expression for properties and collections to capitalize(propertyName|collectionName)
From 17e1c950e87258159d73e71dd125c83fc62bf8e8 Mon Sep 17 00:00:00 2001
From: ari <haskell2000@gmail.com>
Date: Wed, 17 Dec 2014 10:44:56 +0100
Subject: [PATCH] Changed getter name expression for properties and collections
to capitalize(propertyName|collectionName)
---
isis-templates-idea.xml | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/isis-templates-idea.xml b/isis-templates-idea.xml
index bc490fd..a114993 100644
--- a/isis-templates-idea.xml
+++ b/isis-templates-idea.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="isis-templates">
<template name="isa" value="//region &gt; $actionName$ (action)&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;public $ReturnType$ $actionName$(final $ParameterType$ $parameterType$) {&#10; return $END$null; // TODO: business logic here&#10;}&#10;//endregion" description="Isis Action" toReformat="true" toShortenFQNames="true">
<variable name="actionName" expression="&quot;actionName&quot;" defaultValue="" alwaysStopAt="true" />
@@ -190,7 +189,7 @@
</template>
<template name="iscl" value="//region &gt; $collectionName$ (collection)&#10;private java.util.List&lt;$ElementType$&gt; $collectionName$ = com.google.common.collect.Lists.newArrayList();&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;public java.util.List&lt;$ElementType$&gt; get$CollectionName$() {&#10; return $collectionName$;&#10;}&#10;public void set$CollectionName$(final java.util.List&lt;$ElementType$&gt; $collectionName$) {&#10; this.$collectionName$ = $collectionName$;&#10;}&#10;//endregion" description="Isis Collection (List)" toReformat="true" toShortenFQNames="true">
<variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
<variable name="ElementType" expression="className()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML" value="false" />
@@ -206,7 +205,7 @@
</template>
<template name="iscs" value="//region &gt; $collectionName$ (collection)&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = com.google.common.collect.Sets.newTreeSet();&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;public java.util.Set&lt;$ElementType$&gt; get$CollectionName$() {&#10; return $collectionName$;&#10;}&#10;public void set$CollectionName$(final java.util.Set&lt;$ElementType$&gt; $collectionName$) {&#10; this.$collectionName$ = $collectionName$;&#10;}&#10;//endregion" description="Isis Collection (Set)" toReformat="true" toShortenFQNames="true">
<variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
<variable name="ElementType" expression="className()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML" value="false" />
@@ -322,7 +321,7 @@
</template>
<template name="iscs.jdo.1m.b.fk" value="//region &gt; $collectionName$ (collection)&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$elementNameInChild$&quot;, dependentElement=&quot;$trueOrFalse$&quot;)&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;public java.util.SortedSet&lt;$ElementType$&gt; get$CollectionName$() {&#10; return $collectionName$;&#10;}&#10;public void set$CollectionName$(final java.util.SortedSet&lt;$ElementType$&gt; $collectionName$) {&#10; this.$collectionName$ = $collectionName$;&#10;}&#10;//endregion" description="Isis JDO Collection (1:m parent bidirectional to foreign key)" toReformat="true" toShortenFQNames="true">
<variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
<variable name="ElementType" expression="className()" defaultValue="" alwaysStopAt="true" />
<variable name="elementNameInChild" expression="&quot;elementNameInChild&quot;" defaultValue="" alwaysStopAt="true" />
<variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
@@ -340,7 +339,7 @@
</template>
<template name="iscs.jdo.1m.b.jt" value="//region &gt; $collectionName$ (collection)&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$elementNameInChild$&quot;, dependentElement=&quot;$trueOrFalse$&quot;)&#10;@javax.jdo.annotations.Join&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;public java.util.SortedSet&lt;$ElementType$&gt; get$CollectionName$() {&#10; return $collectionName$;&#10;}&#10;public void set$CollectionName$(final java.util.SortedSet&lt;$ElementType$&gt; $collectionName$) {&#10; this.$collectionName$ = $collectionName$;&#10;}&#10;//endregion" description="Isis JDO Collection (1:m parent bidirectional to join table)" toReformat="true" toShortenFQNames="true">
<variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
<variable name="ElementType" expression="className()" defaultValue="" alwaysStopAt="true" />
<variable name="elementNameInChild" expression="&quot;elementNameInChild&quot;" defaultValue="" alwaysStopAt="true" />
<variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
@@ -358,7 +357,7 @@
</template>
<template name="iscs.jdo.1m.u.fk" value="//region &gt; $collectionName$ (collection)&#10;@javax.jdo.annotations.Element(column=&quot;$ColumnName$&quot;, dependent=&quot;$trueOrFalse$&quot;)&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;public java.util.SortedSet&lt;$ElementType$&gt; get$CollectionName$() {&#10; return $collectionName$; &#10;}&#10;public void set$CollectionName$(final java.util.SortedSet&lt;$ElementType$&gt; $collectionName$) { &#10; this.$collectionName$ = $collectionName$;&#10;}&#10;//endregion" description="Isis JDO Collection (1:m parent unidirectional)" toReformat="true" toShortenFQNames="true">
<variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
<variable name="ElementType" expression="className()" defaultValue="" alwaysStopAt="true" />
<variable name="ColumnName" expression="&quot;ColumnName&quot;" defaultValue="" alwaysStopAt="true" />
<variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
@@ -376,7 +375,7 @@
</template>
<template name="iscs.jdo.1m.u.jt" value="//region &gt; $collectionName$ (collection)&#10;@javax.jdo.annotations.Join&#10;@javax.jdo.annotations.Element(dependent=&quot;$trueOrFalse$&quot;)&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;public java.util.SortedSet&lt;$ElementType$&gt; get$CollectionName$() {&#10; return $collectionName$;&#10;} &#10;public void set$CollectionName$(final java.util.SortedSet&lt;$ElementType$&gt; $collectionName$) {&#10; this.$collectionName$ = $collectionName$;&#10;}&#10;//endregion" description="Isis JDO Collection (1:m parent unidirectional to join table)" toReformat="true" toShortenFQNames="true">
<variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
<variable name="ElementType" expression="className()" defaultValue="" alwaysStopAt="true" />
<variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
<context>
@@ -393,7 +392,7 @@
</template>
<template name="iscs.jdo.mn.ub.c" value="//region &gt; $collectionName$ (collection)&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$ChildCollectionNameInParent$&quot;)&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;(); &#10;public java.util.SortedSet&lt;$ElementType$&gt; get$CollectionName$() { &#10; return $collectionName$; &#10;} &#10;public void set$CollectionName$(final java.util.SortedSet&lt;$ElementType$&gt; $collectionName$) { &#10; this.$collectionName$ = $collectionName$; &#10;} &#10;//endregion" description="Isis JDO Collection (m:n child)" toReformat="true" toShortenFQNames="true">
<variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
<variable name="ElementType" expression="className()" defaultValue="" alwaysStopAt="true" />
<variable name="ChildCollectionNameInParent" expression="&quot;ChildCollectionNameInParent&quot;" defaultValue="" alwaysStopAt="true" />
<context>
@@ -410,7 +409,7 @@
</template>
<template name="iscs.jdo.mn.ub.p" value="//region &gt; $collectionName$ (collection)&#10;@javax.jdo.annotations.Persistent(table=&quot;$TableName$&quot;) &#10;@javax.jdo.annotations.Join(column=&quot;$ThisEntityFieldName$&quot;) &#10;@javax.jdo.annotations.Element(column=&quot;$RelatedEntityFieldName$&quot;) &#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;) &#10;public java.util.SortedSet&lt;$ElementType$&gt; get$CollectionName$() { &#10; return $collectionName$; &#10;} &#10;public void set$CollectionName$(final java.util.SortedSet&lt;$ElementType$&gt; $collectionName$) { &#10; this.$collectionName$ = $collectionName$; &#10;} &#10;//endregion" description="Isis JDO Collection (m:n parent)" toReformat="true" toShortenFQNames="true">
<variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
<variable name="ElementType" expression="className()" defaultValue="" alwaysStopAt="true" />
<variable name="TableName" expression="&quot;TableName&quot;" defaultValue="" alwaysStopAt="true" />
<variable name="ThisEntityFieldName" expression="&quot;ThisEntityFieldName&quot;" defaultValue="" alwaysStopAt="true" />
@@ -429,7 +428,7 @@
</template>
<template name="isp.jdo" value="//region &gt; $propertyName$ (property)&#10;private $PropertyType$ $propertyName$;&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;@javax.jdo.annotations.Column(allowsNull=&quot;$trueOrFalse$&quot;)&#10;public $PropertyType$ get$PropertyName$() {&#10; return $propertyName$;&#10;}&#10;public void set$PropertyName$(final $PropertyType$ $propertyName$) {&#10; this.$propertyName$ = $propertyName$;&#10;}&#10;//endregion" description="Isis JDO Property" toReformat="true" toShortenFQNames="true">
<variable name="propertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="PropertyName" expression="capitalize(propertyName)" defaultValue="" alwaysStopAt="false" />
<variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
<variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
<context>
@@ -446,7 +445,7 @@
</template>
<template name="isp.jdo.11c" value="//region &gt; $propertyName$ (property)&#10;private $PropertyType$ $propertyName$;&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;@javax.jdo.annotations.Column(allowsNull=&quot;$trueOrFalse$&quot;)&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$fieldOnChild$&quot;)&#10;public $PropertyType$ get$PropertyName$() { &#10; return $propertyName$; &#10;}&#10;public void set$PropertyName$(final $PropertyType$ $propertyName$) {&#10; this.$propertyName$ = $propertyName$;&#10;}&#10;//endregion" description="Isis JDO Property (1:1 bidirectional parent to foreign key)" toReformat="true" toShortenFQNames="true">
<variable name="propertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="PropertyName" expression="capitalize(propertyName)" defaultValue="" alwaysStopAt="false" />
<variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
<variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
<variable name="fieldOnChild" expression="&quot;fieldOnChild&quot;" defaultValue="" alwaysStopAt="true" />
@@ -542,7 +541,7 @@
</template>
<template name="isp" value="//region &gt; $propertyName$ (property)&#10;private $PropertyType$ $propertyName$;&#10;@org.apache.isis.applib.annotation.MemberOrder(sequence=&quot;1&quot;)&#10;public $PropertyType$ get$PropertyName$() {&#10; return $propertyName$;&#10;}&#10;public void set$PropertyName$(final $PropertyType$ $propertyName$) {&#10; this.$propertyName$ = $propertyName$;&#10;}&#10;//endregion" description="Isis Property" toReformat="true" toShortenFQNames="true">
<variable name="propertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
- <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
+ <variable name="PropertyName" expression="capitalize(propertyName)" defaultValue="" alwaysStopAt="false" />
<variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML" value="false" />
@@ -801,4 +800,3 @@
</context>
</template>
</templateSet>
-
--
1.9.3 (Apple Git-50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment