toStringTemplates.xml 1.26 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
<application>
  <component name="ToStringTemplates">
    <option name="defaultTempalteName" value="StringBuffer" />
    <option name="templates">
      <list>
        <TemplateResource>
          <option name="fileName" value="custom_tostring" />
          <option name="template" value="public java.lang.String toString() {&#10;#if ( $members.size() &gt; 0 )&#10;#set ( $i = 0 )&#10;    return &quot;$classname{&quot; +&#10;#foreach( $member in $members )&#10;#if ( $i == 0 )&#10;    &quot;##&#10;#else&#10;    &quot;, ##&#10;#end&#10;#if ( $member.objectArray )&#10;#if ($java_version &lt; 5)&#10;$member.name=&quot; + ($member.accessor == null ? null : java.util.Arrays.asList($member.accessor)) +&#10;#else&#10;$member.name=&quot; + java.util.Arrays.toString($member.accessor) +&#10;#end&#10;#elseif ( $member.primitiveArray &amp;&amp; $java_version &gt;= 5)&#10;$member.name=&quot; + java.util.Arrays.toString($member.accessor) +&#10;#elseif ( $member.string )&#10;$member.name='&quot; + $member.accessor + '\'' +&#10;#else&#10;$member.name=&quot; + $member.accessor +&#10;#end&#10;#set ( $i = $i + 1 )&#10;#end&#10;    '}'+ '\n';&#10;#else&#10;    return &quot;$classname{}&quot;;&#10;#end&#10;}" />
        </TemplateResource>
      </list>
    </option>
  </component>
</application>