本文整理汇总了Java中org.thymeleaf.model.IText类的典型用法代码示例。如果您正苦于以下问题:Java IText类的具体用法?Java IText怎么用?Java IText使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IText类属于org.thymeleaf.model包,在下文中一共展示了IText类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleText
import org.thymeleaf.model.IText; //导入依赖的package包/类
@Override
public void handleText(final IText text) {
final String contentString = text.getText();
if (!contentString.isEmpty() && contentString.trim().isEmpty()) {
if (!writeWhitespace) {
return;
}
writeWhitespace = false;
}
super.handleText(text);
}
示例2: doProcess
import org.thymeleaf.model.IText; //导入依赖的package包/类
@Override
public void doProcess(ITemplateContext context, IText text, ITextStructureHandler structureHandler) {
String content = text.getText();
if (!StringUtils.hasText(content)) {
structureHandler.removeText();
}
}
示例3: doProcess
import org.thymeleaf.model.IText; //导入依赖的package包/类
@Override
void doProcess(IModel model, IText attributeValue) {
Integer position = getPositionOfReplaceableTextEvent(model);
if (position != null) {
model.replace(position, attributeValue);
}
}
示例4: getPositionOfReplaceableTextEvent
import org.thymeleaf.model.IText; //导入依赖的package包/类
private Integer getPositionOfReplaceableTextEvent(IModel model) {
Integer lastPosition = null;
for (int i = 0; i < model.size(); i++) {
if (model.get(i) instanceof IText) {
lastPosition = i;
}
}
return lastPosition;
}
示例5: getPositionOfFirstTextEvent
import org.thymeleaf.model.IText; //导入依赖的package包/类
private Integer getPositionOfFirstTextEvent(IModel model) {
for (int i = 0; i < model.size(); i++) {
if (model.get(i) instanceof IText) {
return i;
}
}
return null;
}
示例6: doProcess
import org.thymeleaf.model.IText; //导入依赖的package包/类
@Override
void doProcess(IModel model, IText attributeValue) {
Integer positionOfFirstTextEvent = getPositionOfFirstTextEvent(model);
if (positionOfFirstTextEvent != null) {
model.replace(positionOfFirstTextEvent, attributeValue);
} else {
//nothing set, we need to add the value after the opened element that contained or attribute
model.insert(1, attributeValue);
}
}
示例7: getAttributeValueAsEvent
import org.thymeleaf.model.IText; //导入依赖的package包/类
private IText getAttributeValueAsEvent(ITemplateContext context, String attributeValue) {
String evaluatedAttributeValue = getEvaluatedAttributeValue(context, attributeValue);
IModelFactory modelFactory = getModelFactory(context);
return modelFactory.createText(evaluatedAttributeValue);
}
示例8: doProcess
import org.thymeleaf.model.IText; //导入依赖的package包/类
abstract void doProcess(IModel model, IText attributeValue);