I'm trying to create a snippets to automatically generate getters and setters in java
The problem is that i don't know how to split the string taken from $TM_SELECTED_TEXT
The code needs to be inserted below the constructor
After I select the text it's look like this String name
Here's the code, I miss split string and the insert of the code under constructor because I have no idea how to do it
<snippet>
<content><![CDATA[
public void set$TM_SELECTED_TEXT($TM_SELECTED_TEXT $TM_SELECTED_TEXT) {
this.$TM_SELECTED_TEXT = $TM_SELECTED_TEXT;
}
public $TM_SELECTED_TEXT get$TM_SELECTED_TEXT {
return this.$TM_SELECTED_TEXT;
}
]]></content>
<tabTrigger>getter_setter</tabTrigger>
<scope>source.java</scope>
</snippet>
I also would like to know how to change the first letter of the varname to uppercase just to make it look getName and setName instead of setname and getname*