public class NewLineAltererFor extends Object
Convenience functions for creating line alterers tailored for codelets.
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. http://codelet.aliteralmind.com, https://github.com/aliteralmind/codeletTextLineAlterer,
NewTextLineAltererFor| Modifier and Type | Method and Description |
|---|---|
static TextLineAlterer |
eliminateIndentationOrNull(String indentRegexToElim_emptyStrIfNone,
Appendable debugDest_ifNonNull)
Eliminates indentation from every line, if desired.
|
static TextLineAlterer |
eliminatePackageLine(Appendable dbgEveryLine_ifNonNull,
Appendable dbgPkgLnVldtr_ifNonNull)
Eliminates the package declaration line.
|
static TextLineAlterer |
elimPackageReferences(CodeletInstance instance,
Appendable dbgRplcr_ifNonNull)
Eliminates all references to a package.
|
public static final TextLineAlterer elimPackageReferences(CodeletInstance instance, Appendable dbgRplcr_ifNonNull)
Eliminates all references to a package. Use in conjunction with eliminatePackageLine.
NewTextLineAltererFor.replacement(AlterationRequired.YES,NewPatternFor.literal(TagletTextUtil.getExamplePackageName(instance) + "."), "",ReplacedInEachInput.ALL, dbgRplcr_ifNonNull, null)
public static final TextLineAlterer eliminatePackageLine(Appendable dbgEveryLine_ifNonNull, Appendable dbgPkgLnVldtr_ifNonNull)
Eliminates the package declaration line.
WhereNewTextLineAltererFor.text(packageLinePtrn, firstOccuranceFilter, dbgPkgLnVldtr_ifNonNull)
packageLinePtrn is
Pattern.compile(JavaRegexes.PACKAGE_DECL_ONE_LINE_NO_CMTS)
firstOccuranceFilter is a
NewValidResultFilterFor.inUnchangedOutFalse(1, 1, null, null, dbgEveryLine_ifNonNull);elimPackageReferencespublic static final TextLineAlterer eliminateIndentationOrNull(String indentRegexToElim_emptyStrIfNone, Appendable debugDest_ifNonNull)
Eliminates indentation from every line, if desired.
indentRegexToElim_emptyStrIfNone - The regular expression representing the indentation to eliminate. May not be null. Must begin with a line-start anchor '^' and otherwise contain only spaces (' ') and tabs '\t'.indentRegexToElim_emptyStrIfNone.length() is0: null.NewTextLineAltererFor.replacement(AlterationRequired.YES,Pattern.compile(indentRegexToElim_emptyStrIfNone), "",ReplacedInEachInput.FIRST, debugDest_ifNonNull, null)
Copyright 2014, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
https://github.com/aliteralmind/codelet