All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.easydoc.semantics.paramrule.IgnoreParamRule Maven / Gradle / Ivy

package com.github.easydoc.semantics.paramrule;

import com.github.easydoc.model.Doc;
import com.github.easydoc.model.Model;
import com.github.easydoc.semantics.PositiveValidationResult;
import com.github.easydoc.semantics.ValidationResult;

/*@@easydoc-start, belongs=easydoc-parameters@@

ignore

With this parameter you can ignore certain characters in doc's text. Those characters won't get to the resulting HTML.

The value is a string of characters, which should be ignored. To ignore comma (','), escape it with backslash ('\\,').

Example:
#\@\@easydoc-start, ignore=#&\\,\@\@
#
# Lock, stock & 2 smoking barrels
#
#\@\@easydoc-end\@\@

will result in
Lock stock  2 smoking barrels
@@easydoc-end@@*/ public class IgnoreParamRule implements ParamRule { @Override public boolean requiresValue() { return true; } @Override public ValidationResult validate(String value, Doc doc, Model model) { return PositiveValidationResult.getDefaultInstance(); } @Override public void run(String value, Doc doc, Model model, ValidationResult validationResult) { for(int i = 0; i < value.length(); i++) { doc.setText( doc.getText().replace("" + value.charAt(i), "") ); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy