当前位置: 首页>>代码示例>>Java>>正文


Java StringEscapeUtils.unescapeXml方法代码示例

本文整理汇总了Java中org.apache.commons.text.StringEscapeUtils.unescapeXml方法的典型用法代码示例。如果您正苦于以下问题:Java StringEscapeUtils.unescapeXml方法的具体用法?Java StringEscapeUtils.unescapeXml怎么用?Java StringEscapeUtils.unescapeXml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.text.StringEscapeUtils的用法示例。


在下文中一共展示了StringEscapeUtils.unescapeXml方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkStyleCSS

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
final private void checkStyleCSS(TagNode node)
		throws ClientProtocolException, IllegalStateException, IOException, SearchLibException, URISyntaxException {
	if (!("style".equalsIgnoreCase(node.getName())))
		return;
	String attr = node.getAttributeByName("type");
	if (!StringUtils.isEmpty(attr) && !"text/css".equalsIgnoreCase(attr))
		return;
	attr = node.getAttributeByName("media");
	if (!StringUtils.isEmpty(attr) && !"screen".equalsIgnoreCase(attr) && !"all".equalsIgnoreCase(attr))
		return;
	StringBuilder builder = (StringBuilder) node.getText();
	if (builder == null)
		return;
	String content = builder.toString();
	String newContent = StringEscapeUtils.unescapeXml(content);
	StringBuffer sb = checkCSSContent(baseUrl, newContent);
	if (sb != null)
		newContent = sb.toString();
	if (newContent.equals(content))
		return;
	node.removeAllChildren();
	node.addChild(new ContentNode(newContent));
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:24,代码来源:HtmlArchiver.java

示例2: checkScriptContent

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
final private void checkScriptContent(TagNode node, Set<TagNode> disableScriptNodeSet) {
	if (!("script".equalsIgnoreCase(node.getName())))
		return;
	if (disableScriptNodeSet != null && hasAncestorXPath(disableScriptNodeSet, node)) {
		node.removeFromTree();
		return;
	}
	StringBuilder builder = (StringBuilder) node.getText();
	if (builder == null)
		return;
	String content = builder.toString();
	if (content == null)
		return;
	String newContent = StringEscapeUtils.unescapeXml(content);
	if (newContent.equals(content))
		return;
	node.removeAllChildren();
	node.addChild(new ContentNode(newContent));
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:20,代码来源:HtmlArchiver.java

示例3: load

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
public void load(Node parentNode) throws XPathExpressionException {
	synchronized (this) {
		if (parentNode == null)
			return;
		List<Node> nodeList = DomUtils.getNodes(parentNode, "link");
		for (Node node : nodeList) {
			String sourceName = StringEscapeUtils.unescapeXml(DomUtils.getAttributeText(node, "source"));
			S source = loadSource(sourceName);
			if (source == null)
				continue;
			String targetName = DomUtils.getAttributeText(node, "target");
			T target = loadTarget(targetName, node);
			if (target == null)
				continue;
			add(source, target);
		}
	}
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:19,代码来源:FieldMapGeneric.java

示例4: CommonFieldTarget

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
public CommonFieldTarget(String targetName, Node targetNode) {
	super(targetName);
	removeTag = false;
	convertHtmlEntities = false;
	List<Node> nodeList = DomUtils.getNodes(targetNode, "filter");
	for (Node node : nodeList) {
		if ("yes".equalsIgnoreCase(DomUtils.getAttributeText(node, "removeTag")))
			removeTag = true;
		if ("yes".equalsIgnoreCase(DomUtils.getAttributeText(node, "convertHtmlEntities")))
			convertHtmlEntities = true;
		if ("yes".equalsIgnoreCase(DomUtils.getAttributeText(node, "filePath")))
			filePath = true;
		filePathPrefix = DomUtils.getAttributeText(node, "filePathPrefix");
		if ("yes".equalsIgnoreCase(DomUtils.getAttributeText(node, "crawlUrl")))
			crawlUrl = true;
		List<Node> nl = DomUtils.getNodes(node, "findRegexpTag");
		if (nl.size() > 0)
			findRegexpTag = StringEscapeUtils.unescapeXml(nl.get(0).getTextContent());
		nl = DomUtils.getNodes(node, "replaceRegexpTag");
		if (nl.size() > 0)
			replaceRegexpTag = StringEscapeUtils.unescapeXml(nl.get(0).getTextContent());
		checkRegexpPattern();
	}
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:25,代码来源:CommonFieldTarget.java

示例5: postAcceptFriendInvitation

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
@Override
    public void postAcceptFriendInvitation(Message message) throws IOException {
        logger.info("postAcceptFriendInvitation");
//        将该用户的微信号设置成他的昵称
        String content = StringEscapeUtils.unescapeXml(message.getContent());
        ObjectMapper xmlMapper = new XmlMapper();
        FriendInvitationContent friendInvitationContent = xmlMapper.readValue(content, FriendInvitationContent.class);
        wechatHttpService.setAlias(message.getRecommendInfo().getUserName(), friendInvitationContent.getFromusername());
    }
 
开发者ID:kanjielu,项目名称:jeeves,代码行数:10,代码来源:MessageHandlerImpl.java

示例6: unescape

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
private static String unescape(String s) {
    String tmp = s;
    while (isEscaped(tmp)) {
        tmp = StringEscapeUtils.unescapeXml(tmp);
    }
    return tmp;
}
 
开发者ID:vmichalak,项目名称:sonos-controller,代码行数:8,代码来源:CommandBuilder.java

示例7: ParserFieldTarget

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
public ParserFieldTarget(String name, Node node) {
	super(name, node);
	List<Node> nl = DomUtils.getNodes(node, "captureRegexp");
	if (nl.size() > 0)
		captureRegexp = StringEscapeUtils.unescapeXml(nl.get(0).getTextContent());
	nl = DomUtils.getNodes(node, "removeTag");
	removeTag = nl != null && nl.size() > 0;
	nl = DomUtils.getNodes(node, "convertHtmlEntities");
	convertHtmlEntities = nl != null && nl.size() > 0;
	checkRegexpPattern();
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:12,代码来源:ParserFieldTarget.java

示例8: getAttributeString

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
private final static String getAttributeString(Node node,
		String attributeName, boolean unescapeXml) {
	NamedNodeMap attr = node.getAttributes();
	if (attr == null)
		return null;
	Node n = attr.getNamedItem(attributeName);
	if (n == null)
		return null;
	String t = n.getTextContent();
	if (t == null)
		return null;
	return unescapeXml ? StringEscapeUtils.unescapeXml(t) : t;
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:14,代码来源:XPathParser.java

示例9: unescape

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
public static String unescape(String s) throws UnsupportedEncodingException {
	return StringEscapeUtils.unescapeXml(StringEscapeUtils.unescapeHtml4(URLDecoder.decode(s, "UTF-8")));
}
 
开发者ID:DigitalMediaServer,项目名称:DigitalMediaServer,代码行数:4,代码来源:UPNPHelper.java

示例10: BoostQuery

import org.apache.commons.text.StringEscapeUtils; //导入方法依赖的package包/类
private BoostQuery(Node node) {
	query = StringEscapeUtils.unescapeXml(DomUtils.getText(node));
	boost = XPathParser.getAttributeFloat(node, BOOSTQUERY_ATTR_BOOST);
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:5,代码来源:BoostQuery.java


注:本文中的org.apache.commons.text.StringEscapeUtils.unescapeXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。