001/*license*\ 002 Codelet: Copyright (C) 2014, Jeff Epstein (aliteralmind __DASH__ github __AT__ yahoo __DOT__ com) 003 004 This software is dual-licensed under the: 005 - Lesser General Public License (LGPL) version 3.0 or, at your option, any later version; 006 - Apache Software License (ASL) version 2.0. 007 008 Either license may be applied at your discretion. More information may be found at 009 - http://en.wikipedia.org/wiki/Multi-licensing. 010 011 The text of both licenses is available in the root directory of this project, under the names "LICENSE_lgpl-3.0.txt" and "LICENSE_asl-2.0.txt". The latest copies may be downloaded at: 012 - LGPL 3.0: https://www.gnu.org/licenses/lgpl-3.0.txt 013 - ASL 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt 014\*license*/ 015package com.github.aliteralmind.codelet.simplesig; 016 import com.github.aliteralmind.codelet.CodeletInstance; 017 import com.github.aliteralmind.codelet.CodeletType; 018 import com.github.aliteralmind.codelet.CustomizationInstructions; 019 import com.github.aliteralmind.codelet.alter.NewJDLinkForWordOccuranceNum; 020 import com.github.aliteralmind.codelet.NewLineFilterFor; 021 import com.github.xbn.linefilter.alter.NewTextLineAltererFor; 022 import com.github.xbn.linefilter.alter.TextLineAlterer; 023 import com.github.xbn.linefilter.FilteredLineIterator; 024 import com.github.aliteralmind.codelet.type.SourceCodeTemplate; 025 import com.github.xbn.analyze.alter.ExpirableElements; 026 import com.github.xbn.analyze.alter.MultiAlterType; 027 import com.github.xbn.array.NullElement; 028 import static com.github.aliteralmind.codelet.CodeletBaseConfig.*; 029/** 030 <p>Custom <a href="{@docRoot}/com/github/aliteralmind/codelet/CustomizationInstructions.html#overview">customizers</a> used throughout {@code com.github.xbn.linefilter}.</p> 031 032 * @since 0.1.0 033 * @author Copyright (C) 2014, Jeff Epstein ({@code aliteralmind __DASH__ github __AT__ yahoo __DOT__ com}), dual-licensed under the LGPL (version 3.0 or later) or the ASL (version 2.0). See source code for details. <a href="http://codelet.aliteralmind.com">{@code http://codelet.aliteralmind.com}</a>, <a href="https://github.com/aliteralmind/codelet">{@code https://github.com/aliteralmind/codelet}</a> 034 **/ 035public class zCodeletCustomizers { 036 private static final CustomizationInstructions<SourceCodeTemplate> getSourceConfig_ConstructorParamSearchTermXmpl(CodeletInstance instance, CodeletType needed_defaultAlterType) { 037 String debugPrefix = "ConstructorParamSearchTermXmpl"; 038 039 FilteredLineIterator filter = NewLineFilterFor. 040 eliminateAllCmtBlocksAndPackageLine(instance, debugPrefix, 041 true, true); 042 043 TextLineAlterer[] alterers = { 044 NewTextLineAltererFor.escapeHtml(), 045 NewJDLinkForWordOccuranceNum.constructor(instance, debugPrefix, null, 046 1, ConstructorParamSearchTerm.class, "(*)"), 047 NewJDLinkForWordOccuranceNum.method(instance, debugPrefix, null, 048 1, ConstructorParamSearchTerm.class, "doesMatchAny(*)"), 049 NewJDLinkForWordOccuranceNum.method(instance, debugPrefix, null, 050 1, ConstructorParamSearchTerm.class, "getFirstMatch(*)"), 051 NewJDLinkForWordOccuranceNum.method(instance, debugPrefix, null, 052 1, ConstructorParamSearchTerm.class, "getAllMatches(*)")}; 053 054 return new CustomizationInstructions<SourceCodeTemplate>(instance, 055 needed_defaultAlterType). 056 filter(filter). 057 orderedAlterers(getDebugApblIfOn(instance, debugPrefix + ".allalterer"), 058 NullElement.OK, ExpirableElements.OPTIONAL, 059 MultiAlterType.CUMULATIVE, alterers). 060 defaultOrOverrideTemplate( 061 getDebugApblIfOn(instance, debugPrefix + ".template")). 062 build(); 063 } 064 private static final CustomizationInstructions<SourceCodeTemplate> getSourceConfig_MethodSigSearchTermXmpl(CodeletInstance instance, CodeletType needed_defaultAlterType) { 065 String debugPrefix = "MethodSigSearchTermXmpl"; 066 067 FilteredLineIterator filter = NewLineFilterFor. 068 eliminateAllCmtBlocksAndPackageLine(instance, debugPrefix, 069 true, true); 070 071 TextLineAlterer[] alterers = { 072 NewTextLineAltererFor.escapeHtml(), 073 NewJDLinkForWordOccuranceNum.constructor(instance, debugPrefix, null, 074 1, MethodSigSearchTerm.class, "(*)"), 075 NewJDLinkForWordOccuranceNum.method(instance, debugPrefix, null, 076 1, MethodSigSearchTerm.class, "doesMatchAny(*)"), 077 NewJDLinkForWordOccuranceNum.method(instance, debugPrefix, null, 078 1, MethodSigSearchTerm.class, "getFirstMatch(*)"), 079 NewJDLinkForWordOccuranceNum.method(instance, debugPrefix, null, 080 1, MethodSigSearchTerm.class, "getAllMatches(*)")}; 081 082 return new CustomizationInstructions<SourceCodeTemplate>(instance, 083 needed_defaultAlterType). 084 filter(filter). 085 orderedAlterers(getDebugApblIfOn(instance, debugPrefix + ".allalterer"), 086 NullElement.OK, ExpirableElements.OPTIONAL, 087 MultiAlterType.CUMULATIVE, alterers). 088 defaultOrOverrideTemplate( 089 getDebugApblIfOn(instance, debugPrefix + ".template")). 090 build(); 091 } 092 private zCodeletCustomizers() { 093 throw new IllegalStateException("Do not instantiate."); 094 } 095}