本文整理了Java中net.htmlparser.jericho.Element.toString()
方法的一些代码示例,展示了Element.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.toString()
方法的具体详情如下:
包路径:net.htmlparser.jericho.Element
类名称:Element
方法名:toString
暂无
代码示例来源:origin: wala/WALA
@Override
public String toString() {
return innerElement.toString();
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.cast.js
@Override
public String toString() {
return innerElement.toString();
}
代码示例来源:origin: cflint/CFLint
/**
* Register any overrides from comment elements before functions/components.
*
* @param context
* The current context.
* @param commentElement
* The CFML comment element
*/
protected void applyRuleOverrides(final Context context, final Element commentElement) {
if (commentElement != null && CF.COMMENT.equals(commentElement.getName())) {
final String mlText = commentElement.toString();
final Pattern pattern = Pattern.compile(".*\\s*@CFLintIgnore\\s+([\\w,_]+)\\s*.*", Pattern.DOTALL);
final Matcher matcher = pattern.matcher(mlText);
if (matcher.matches()) {
final String ignoreCodes = matcher.group(1);
context.ignore(Arrays.asList(ignoreCodes.split(",\\s*")));
}
}
}
代码示例来源:origin: cflint/CFLint
/**
* Register any overrides from comment elements before functions/components.
*
* @param context
* The current context.
* @param commentElement
* The CFML comment element
*/
protected void applyRuleOverrides(final Context context, final Element commentElement) {
if (commentElement != null && CF.COMMENT.equals(commentElement.getName())) {
final String mlText = commentElement.toString();
final Pattern pattern = Pattern.compile(".*\\s*@CFLintIgnore\\s+([\\w,_]+)\\s*.*", Pattern.DOTALL);
final Matcher matcher = pattern.matcher(mlText);
if (matcher.matches()) {
final String ignoreCodes = matcher.group(1);
context.ignore(Arrays.asList(ignoreCodes.split(",\\s*")));
}
}
}
代码示例来源:origin: cflint/CFLint
if (prevSibling != null && prevSibling.getName().equals(CF.COMMENT)) {
final Pattern p = Pattern.compile(".*---\\s*CFLINT-DISABLE\\s+(.*)\\s*---.*");
final Matcher m = p.matcher(prevSibling.toString().toUpperCase().trim());
if (m.matches()) {
代码示例来源:origin: cflint/CFLint
if (prevSibling != null && prevSibling.getName().equals(CF.COMMENT)) {
final Pattern p = Pattern.compile(".*---\\s*CFLINT-DISABLE\\s+(.*)\\s*---.*");
final Matcher m = p.matcher(prevSibling.toString().toUpperCase().trim());
if (m.matches()) {
代码示例来源:origin: cflint/CFLint
/**
* Determine the line numbers of the <!--- @CFLintIgnore CFQUERYPARAM_REQ ---> tags
* Both the current and the next line are included.
*
* @param element the element object
* @return the line numbers of any @@CFLintIgnore annotations.
*/
private List<Integer> determineIgnoreLines(final Element element) {
final List<Integer> ignoreLines = new ArrayList<>();
for (Element comment : element.getChildElements()) {
if ("!---".equals(comment.getName()) && comment.toString().contains("@CFLintIgnore") && comment.toString().contains("CFQUERYPARAM_REQ")) {
int ignoreLine = comment.getSource().getRow(comment.getEnd());
ignoreLines.add(ignoreLine);
ignoreLines.add(ignoreLine + 1);
ignoreLines.add(comment.getSource().getRow(comment.getBegin()));
} else {
ignoreLines.addAll(determineIgnoreLines(comment));
}
}
return ignoreLines;
}
代码示例来源:origin: cflint/CFLint
/**
* Determine the line numbers of the <!--- @CFLintIgnore CFQUERYPARAM_REQ ---> tags
* Both the current and the next line are included.
*
* @param element the element object
* @return the line numbers of any @@CFLintIgnore annotations.
*/
private List<Integer> determineIgnoreLines(final Element element) {
final List<Integer> ignoreLines = new ArrayList<>();
for (Element comment : element.getChildElements()) {
if ("!---".equals(comment.getName()) && comment.toString().contains("@CFLintIgnore") && comment.toString().contains("CFQUERYPARAM_REQ")) {
int ignoreLine = comment.getSource().getRow(comment.getEnd());
ignoreLines.add(ignoreLine);
ignoreLines.add(ignoreLine + 1);
ignoreLines.add(comment.getSource().getRow(comment.getBegin()));
} else {
ignoreLines.addAll(determineIgnoreLines(comment));
}
}
return ignoreLines;
}
代码示例来源:origin: cflint/CFLint
@Override
public void element(final Element element, final Context context, final BugList bugs) {
if (element.getName().equals(CF.CFARGUMENT)) {
final String name = element.getAttributeValue(CF.NAME) != null
? element.getAttributeValue(CF.NAME) : "";
ArgInfo argInfo = new ArgInfo();
argInfo.casedName=name;
argInfo.argumentLineNo=context.startLine();
argInfo.argumentOffset=element.getAttributeValue(CF.NAME) != null
? element.getAttributes().get(CF.NAME).getValueSegment().getBegin() : element.getBegin();
argInfo.type=element.getAttributeValue(CF.TYPE);
currentArgs.put(name.toLowerCase(), argInfo);
final String code = element.getParentElement().toString();
if (isUsed(code, name.toLowerCase())) {
argInfo.used=true;
}
}
}
代码示例来源:origin: cflint/CFLint
@Override
public void element(final Element element, final Context context, final BugList bugs) {
if (element.getName().equals(CF.CFARGUMENT)) {
final String name = element.getAttributeValue(CF.NAME) != null
? element.getAttributeValue(CF.NAME) : "";
ArgInfo argInfo = new ArgInfo();
argInfo.casedName=name;
argInfo.argumentLineNo=context.startLine();
argInfo.argumentOffset=element.getAttributeValue(CF.NAME) != null
? element.getAttributes().get(CF.NAME).getValueSegment().getBegin() : element.getBegin();
argInfo.type=element.getAttributeValue(CF.TYPE);
currentArgs.put(name.toLowerCase(), argInfo);
final String code = element.getParentElement().toString();
if (isUsed(code, name.toLowerCase())) {
argInfo.used=true;
}
}
}
代码示例来源:origin: com.github.cfparser/cfml.parsing
visitor.visitElementStart(elem);
if (elem.getName().equalsIgnoreCase("cfset") || elem.getName().equalsIgnoreCase("cfreturn")) {
final String cfscript = elem.toString().substring(elem.getName().length() + 1, elem.toString().length() - 1).trim();
if (cfscript.length() > 0 && visitor.visitPreParseExpression("TAG", cfscript)) {
final CFExpression expression = parseCFExpression(cfscript, visitor);
final int uglyNotPos = elem.toString().lastIndexOf("<>");
int endPos = elem.getStartTag().getEnd() - 1;
final int nextPos = elem.toString().indexOf(">", uglyNotPos + 2);
if (nextPos > 0 && nextPos < elem.getEndTag().getBegin()) {
endPos = nextPos;
final String cfscript = elem.toString().substring(elem.getName().length() + 1, endPos);
if (cfscript.length() > 0 && visitor.visitPreParseExpression("TAG", cfscript)) {
final CFExpression expression = parseCFExpression(cfscript, visitor);
代码示例来源:origin: cflint/CFLint
@Override
public void element(final Element element, final Context context, final BugList bugs) {
if (element.getName().equals(CF.CFARGUMENT)) {
final String name = element.getAttributeValue(CF.NAME);
final boolean required = CFTool.toBoolean(element.getAttributeValue(CF.REQUIRED));
final String defaultExpr = element.getAttributeValue(CF.DEFAULT);
final String code = element.getParentElement().toString();
final boolean checked = isCheck(code, name);
if (!required && defaultExpr == null && !checked) {
element.getSource().getRow(element.getBegin());
element.getSource().getColumn(element.getBegin());
context.addMessage("ARG_DEFAULT_MISSING", name);
}
}
}
代码示例来源:origin: cflint/CFLint
@Override
public void element(final Element element, final Context context, final BugList bugs) {
if (element.getName().equals(CF.CFARGUMENT)) {
final String name = element.getAttributeValue(CF.NAME);
final boolean required = CFTool.toBoolean(element.getAttributeValue(CF.REQUIRED));
final String defaultExpr = element.getAttributeValue(CF.DEFAULT);
final String code = element.getParentElement().toString();
final boolean checked = isCheck(code, name);
if (!required && defaultExpr == null && !checked) {
element.getSource().getRow(element.getBegin());
element.getSource().getColumn(element.getBegin());
context.addMessage("ARG_DEFAULT_MISSING", name);
}
}
}
代码示例来源:origin: cflint/CFLint
bldr.setExpression(((CFScriptStatement) expression).Decompile(0));
} else if (elem != null) {
bldr.setExpression(elem.toString().replaceAll("\r\n", "\n"));
代码示例来源:origin: cflint/CFLint
bldr.setExpression(((CFScriptStatement) expression).Decompile(0));
} else if (elem != null) {
bldr.setExpression(elem.toString().replaceAll("\r\n", "\n"));
内容来源于网络,如有侵权,请联系作者删除!