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


Java Element.setTextContent方法代码示例

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


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

示例1: toDOM

import org.w3c.dom.Element; //导入方法依赖的package包/类
private Element toDOM(Document doc, String tag, List<String> conceptIDs) {
	Element result = doc.createElement(tag);
	for (Token t : tokens) {
		Element te = t.toDOM(doc, "t");
		result.appendChild(te);
	}
	Element hte = headToken.toDOM(doc, "ht");
	result.appendChild(hte);
	if (head != null) {
		Element he = head.toDOM(doc, "head");
		result.appendChild(he);
	}
	for (Candidate mod : modifiers) {
		Element me = mod.toDOM(doc, "mod");
		result.appendChild(me);
	}
	for (String cid : conceptIDs) {
		Element ce = doc.createElement("concept");
		ce.setTextContent(cid);
		result.appendChild(ce);
	}
	return result;
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:24,代码来源:Candidate.java

示例2: getServiceResult

import org.w3c.dom.Element; //导入方法依赖的package包/类
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
	String projectName = request.getParameter("projectName");
	
	Element root = document.getDocumentElement();
       Element projectStatistic = document.createElement("statistics");
       projectStatistic.setAttribute("project", projectName);
       Project project = Engine.theApp.databaseObjectsManager.getOriginalProjectByName(projectName);
       
       Map<String,String> mapStatsProject = ProjectUtils.getStatByProject(project);
       
       if(mapStatsProject != null && mapStatsProject.size()>0) {
           for(String key : mapStatsProject.keySet()) {
           	Element obj = document.createElement(key.replaceAll(" ", "_"));
           	obj.setTextContent(mapStatsProject.get(key));
           	projectStatistic.appendChild(obj);
           }
       }

       root.appendChild(projectStatistic);
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:21,代码来源:GetStatistic.java

示例3: appendEmailCriterion

import org.w3c.dom.Element; //导入方法依赖的package包/类
private void appendEmailCriterion(Document doc, ChargingData chargingData,
        Element analysisNode) {
    Element emailCriterion = doc
            .createElement(HeidelpayXMLTags.XML_ANALYSIS_CRITERION);
    emailCriterion.setAttribute(HeidelpayXMLTags.XML_ATTRIBUTE_NAME,
            HeidelpayXMLTags.XML_ANALYSIS_EMAIL);
    if (chargingData.getEmail() != null) {
        emailCriterion.setTextContent(chargingData.getEmail());
    }
    analysisNode.appendChild(emailCriterion);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:12,代码来源:PaymentServiceProviderBean.java

示例4: patch

import org.w3c.dom.Element; //导入方法依赖的package包/类
@Override
public List<DavResource> patch(String url, Map<QName, String> setProps, List<QName> removeProps) throws IOException {
    List<Element> setPropsElements = new ArrayList<>();
    for (Map.Entry<QName, String> entry : setProps.entrySet()) {
        Element element = SardineUtil.createElement(entry.getKey());
        element.setTextContent(entry.getValue());
        setPropsElements.add(element);
    }
    return this.patch(url, setPropsElements, removeProps);
}
 
开发者ID:thegrizzlylabs,项目名称:sardine-android,代码行数:11,代码来源:OkHttpSardine.java

示例5: saveToDom

import org.w3c.dom.Element; //导入方法依赖的package包/类
protected Element saveToDom(final Element element) throws FinalizationException {
    super.saveToDom(element);
    
    final Document document = element.getOwnerDocument();
    
    element.setAttribute(VERSION_TAG_NAME, version.toString());
    element.setAttribute(PLATFORMS_TAG_NAME,
            StringUtils.asString(supportedPlatforms, StringUtils.SPACE));
    element.setAttribute(STATUS_TAG_NAME, currentStatus.toString());
    element.setAttribute(FEATURES_TAG_NAME,
            StringUtils.asString(features, StringUtils.SPACE));
    
    element.appendChild(XMLUtils.saveExtendedUrisList(
            logicUris,
            document.createElement(CONFIGURATION_LOGIC_TAG_NAME)));//NOI18N
    
    element.appendChild(XMLUtils.saveExtendedUrisList(
            dataUris,
            document.createElement(INSTALLATION_DATA_TAG_NAME)));//NOI18N
    
    final Element systemRequirementsElement =
            document.createElement(SYSTEM_REQUIREMENTS_TAG_NAME);//NOI18N
    
    final Element diskSpaceElement =
            document.createElement(DISK_SPACE_TAG_NAME);//NOI18N
    diskSpaceElement.setTextContent(Long.toString(requiredDiskSpace));
    systemRequirementsElement.appendChild(diskSpaceElement);
    
    element.appendChild(systemRequirementsElement);
    
    if (dependencies.size() > 0) {
        element.appendChild(XMLUtils.saveDependencies(
                dependencies,
                document.createElement(DEPENDENCIES_TAG_NAME)));//NOI18N
    }
    
    return element;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:Product.java

示例6: getServiceResult

import org.w3c.dom.Element; //导入方法依赖的package包/类
@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
	Element root = document.getDocumentElement();
	Element message = document.createElement("message");
	root.appendChild(message);
	
	File storeDirectory = new File(Engine.USER_WORKSPACE_PATH, StoreFiles.STORE_DIRECTORY_NAME);
	if (storeDirectory.exists()) {
		FileUtils.deleteDirectory(storeDirectory);
		message.setTextContent("The custom Store has correctly been deleted.");
	}
	else {
		message.setTextContent("No custom Store has been uploaded.");
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:16,代码来源:DeleteCustomStore.java

示例7: getServiceResult

import org.w3c.dom.Element; //导入方法依赖的package包/类
@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
	Element root = document.getDocumentElement();

	Element method = document.createElement("method");
	method.setTextContent(request.getMethod());
	root.appendChild(method);

	Element url = document.createElement("url");
	url.setTextContent(request.getRequestURL().toString());
	root.appendChild(url);
	
	String queryString = request.getQueryString();
	if (StringUtils.isNotEmpty(queryString)) {
		Element query = document.createElement("query");
		query.setTextContent(queryString);
		root.appendChild(query);
	}
	
	Element headers = document.createElement("headers");

	for (Enumeration<String> headerEnum = request.getHeaderNames(); headerEnum.hasMoreElements();) {
		String headerName = headerEnum.nextElement();

		for (Enumeration<String> valueEnum = request.getHeaders(headerName); valueEnum.hasMoreElements();) {
			String headerValue = valueEnum.nextElement();

			Element header = document.createElement("header");
			header.setAttribute("name", headerName);
			header.setTextContent(headerValue);
			headers.appendChild(header);
		}
	}

	root.appendChild(headers);
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:37,代码来源:EchoHttp.java

示例8: marshall

import org.w3c.dom.Element; //导入方法依赖的package包/类
@Override
public Node marshall(Document document) {
    Element signatureValue = createThisElement(document);

    Element tag = document.createElement("DSigValue");
    tag.setTextContent(this.dsigValue);
    signatureValue.appendChild(tag);

    Element accumulatorValue = document.createElement("AccumulatorValue");
    accumulatorValue.setTextContent(this.accumulatorValue);
    signatureValue.appendChild(accumulatorValue);

    return signatureValue;
}
 
开发者ID:woefe,项目名称:xmlrss,代码行数:15,代码来源:GSSignatureValue.java

示例9: getServiceResult

import org.w3c.dom.Element; //导入方法依赖的package包/类
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
	Element root = document.getDocumentElement();
	String projectName = request.getParameter("projectName");
	final Set<String> allUndefinedSymbols = Engine.theApp.databaseObjectsManager.symbolsGetUndefined(projectName);
	
	Element undefined_symbols = document.createElement("undefined_symbols");
	if (allUndefinedSymbols != null) {
		for (String undefinedSymbol : new TreeSet<String>(allUndefinedSymbols)) {
			Element symbol = document.createElement("symbol");
			symbol.setTextContent(undefinedSymbol);
			undefined_symbols.appendChild(symbol);
		}
	}
	root.appendChild(undefined_symbols);
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:16,代码来源:GetUndefinedSymbols.java

示例10: marshall

import org.w3c.dom.Element; //导入方法依赖的package包/类
@Override
public Node marshall(Document document) {
    Element simpleProof = createThisElement(document);
    Element data = createElement(document, "Data");
    data.setTextContent(proof);
    simpleProof.appendChild(data);
    return simpleProof;
}
 
开发者ID:woefe,项目名称:xmlrss,代码行数:9,代码来源:SimpleProof.java

示例11: writeXml

import org.w3c.dom.Element; //导入方法依赖的package包/类
@Override
public Node writeXml(Document document) throws Exception {
	Element self = document.createElement(getClass().getSimpleName());
	JSONObject jsonObject = new JSONObject();
	try {
		jsonObject.put("mode", mode.name().toLowerCase());
		jsonObject.put("value", getSmartValue());
	} catch (JSONException e) {
		e.printStackTrace();
	}
	self.setTextContent(jsonObject.toString());
	return self;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:14,代码来源:MobileSmartSourceType.java

示例12: appendVatAmountCriterion

import org.w3c.dom.Element; //导入方法依赖的package包/类
private void appendVatAmountCriterion(Document doc,
        ChargingData chargingData, Element analysisNode) {
    Element vatAmountCriterion = doc
            .createElement(HeidelpayXMLTags.XML_ANALYSIS_CRITERION);
    vatAmountCriterion.setAttribute(HeidelpayXMLTags.XML_ATTRIBUTE_NAME,
            HeidelpayXMLTags.XML_ANALYSIS_AMOUNT_VAT);
    String vatAmountAsString = chargingData.getVatAmount() == null ? "null"
            : chargingData.getVatAmount().toPlainString();
    vatAmountCriterion.setTextContent(vatAmountAsString);
    analysisNode.appendChild(vatAmountCriterion);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:12,代码来源:PaymentServiceProviderBean.java

示例13: create

import org.w3c.dom.Element; //导入方法依赖的package包/类
private Element create( String tagName, String content ) {
	Element child = doc.createElement( tagName );
	child.setTextContent( content );
	return child;
}
 
开发者ID:Paulpanther,项目名称:Random-Music-Generator,代码行数:6,代码来源:XMLGenerator.java

示例14: getServiceResult

import org.w3c.dom.Element; //导入方法依赖的package包/类
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {		
	String cacheManagerFileType = "com.twinsoft.convertigo.engine.cache.FileCacheManager";	
	
	Element root = document.getDocumentElement();			
	Element cacheTypeElt= document.createElement("cacheType");	
	String cacheType=EnginePropertiesManager.getProperty(PropertyName.CACHE_MANAGER_CLASS);		
	cacheTypeElt.setTextContent(cacheType);
	root.appendChild(cacheTypeElt);
	
	if(!cacheType.equals(cacheManagerFileType)){
		
		Properties dbCacheProp = new Properties();
		String dbCachePropFileName = Engine.CONFIGURATION_PATH + DatabaseCacheManager.DB_PROP_FILE_NAME;		
		dbCacheProp.load(new FileInputStream(dbCachePropFileName.toString()));
		
		String url,databaseType,serverName,port,databaseName;
		
		url=dbCacheProp.getProperty("jdbc.url");
			
		databaseType=url.replaceFirst("://(.*)", "").replaceAll("(.*):", "");
		url=url.replaceFirst("(.*)://", "");
		serverName=url.replaceFirst("\\:(.*)", "");
		url=url.replaceFirst("(.*)\\:", "");
		port=url.replaceFirst("/(.*)", "");
		databaseName=url.replaceFirst("(.*)/", "");
		
		Element databaseTypeElt= document.createElement("databaseType");					
		databaseTypeElt.setTextContent(databaseType);
		root.appendChild(databaseTypeElt);
		
		Element serverNameElt= document.createElement("serverName");					
		serverNameElt.setTextContent(serverName);
		root.appendChild(serverNameElt);
		
		Element portElt= document.createElement("port");					
		portElt.setTextContent(port);
		root.appendChild(portElt);
		
		Element databaseNameElt= document.createElement("databaseName");					
		databaseNameElt.setTextContent(databaseName);
		root.appendChild(databaseNameElt);			
		
		Element name= document.createElement("userName");					
		name.setTextContent(dbCacheProp.getProperty("jdbc.user.name"));
		root.appendChild(name);
		
		Element password= document.createElement("userPassword");					
		password.setTextContent(Crypto2.decodeFromHexString(dbCacheProp.getProperty("jdbc.user.password")));
		root.appendChild(password);		
		
	}
	
      
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:55,代码来源:ShowProperties.java

示例15: forceImpliesViaConstraint

import org.w3c.dom.Element; //导入方法依赖的package包/类
private static void forceImpliesViaConstraint(Element parent, Document doc, Optionable option1, Optionable option2) {
	Element e = doc.createElement("constraint");
	e.setTextContent(generateName(option1) + IMPLIES + generateName(option2));
	parent.appendChild(e);
}
 
开发者ID:NeoRoy,项目名称:KeYExperienceReport,代码行数:6,代码来源:SPL2OpltionGenerator.java


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