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


Java Element.getTextContent方法代码示例

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


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

示例1: loadRule

import org.w3c.dom.Element; //导入方法依赖的package包/类
private RuleConfig loadRule(Element element) throws SQLSyntaxErrorException {
    Element columnsEle = ConfigUtil.loadElement(element, "columns");
    String column = columnsEle.getTextContent();
    if (StringUtil.isEmpty(column)) {
        throw new ConfigException("no rule column is found");
    }
    String[] columns = SplitUtil.split(column, ',', true);
    if (columns.length > 1) {
        throw new ConfigException("table rule coulmns has multi values:" +
                columnsEle.getTextContent());
    }
    Element algorithmEle = ConfigUtil.loadElement(element, "algorithm");
    String algorithmName = algorithmEle.getTextContent();

    if (StringUtil.isEmpty(algorithmName)) {
        throw new ConfigException("algorithm is null or empty");
    }
    AbstractPartitionAlgorithm algorithm = functions.get(algorithmName);
    if (algorithm == null) {
        throw new ConfigException("can't find function of name :" + algorithmName);
    }
    return new RuleConfig(column.toUpperCase(), algorithmName, algorithm);
}
 
开发者ID:actiontech,项目名称:dble,代码行数:24,代码来源:XMLRuleLoader.java

示例2: ReplaceOperatorRule

import org.w3c.dom.Element; //导入方法依赖的package包/类
public ReplaceOperatorRule(String operatorTypeName, Element element) throws XMLException {
	super(operatorTypeName, element);
	assert (element.getTagName().equals("replaceOperator"));
	NodeList children = element.getChildNodes();
	for (int i = 0; i < children.getLength(); i++) {
		Node child = children.item(i);
		if (child instanceof Element) {
			Element childElement = (Element) child;
			if (childElement.getTagName().equals("replacement")) {
				replacementName = childElement.getTextContent();
			} else if (childElement.getTagName().equals("condition")) {
				parseCondition(childElement);
			} else {
				parseRules.add(XMLImporter.constructRuleFromElement(operatorTypeName, childElement));
			}
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:19,代码来源:ReplaceOperatorRule.java

示例3: impersonate

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**  Start an impersonated session with Kaltura's server.   The result KS is the
session key that you should pass to all services that requires a ticket.     */
 public String impersonate(String secret, int impersonatedPartnerId, String userId, KalturaSessionType type, int partnerId, int expiry, String privileges) throws KalturaApiException {
     KalturaParams kparams = new KalturaParams();
     kparams.add("secret", secret);
     kparams.add("impersonatedPartnerId", impersonatedPartnerId);
     kparams.add("userId", userId);
     kparams.add("type", type);
     kparams.add("partnerId", partnerId);
     kparams.add("expiry", expiry);
     kparams.add("privileges", privileges);
     this.kalturaClient.queueServiceCall("session", "impersonate", kparams);
     if (this.kalturaClient.isMultiRequest())
         return null;
     Element resultXmlElement = this.kalturaClient.doQueue();
     String resultText = resultXmlElement.getTextContent();
     return ParseUtils.parseString(resultText);
 }
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:19,代码来源:KalturaSessionService.java

示例4: xAddBulkDownload

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**  Creates new download job for multiple entry ids (comma separated), an email will
be sent when the job is done   This sevice support the following entries:    -
MediaEntry   - Video will be converted using the flavor params id   - Audio will
be downloaded as MP3   - Image will be downloaded as Jpeg   - MixEntry will be
flattened using the flavor params id   - Other entry types are not supported  
Returns the admin email that the email message will be sent to      */
 public String xAddBulkDownload(String entryIds, String flavorParamsId) throws KalturaApiException {
     KalturaParams kparams = new KalturaParams();
     kparams.add("entryIds", entryIds);
     kparams.add("flavorParamsId", flavorParamsId);
     this.kalturaClient.queueServiceCall("xinternal", "xAddBulkDownload", kparams);
     if (this.kalturaClient.isMultiRequest())
         return null;
     Element resultXmlElement = this.kalturaClient.doQueue();
     String resultText = resultXmlElement.getTextContent();
     return ParseUtils.parseString(resultText);
 }
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:18,代码来源:KalturaXInternalService.java

示例5: count

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**  Count media entries by filter.     */
public int count(KalturaMediaEntryFilter filter) throws KalturaApiException {
    KalturaParams kparams = new KalturaParams();
    kparams.add("filter", filter);
    this.kalturaClient.queueServiceCall("media", "count", kparams);
    if (this.kalturaClient.isMultiRequest())
        return 0;
    Element resultXmlElement = this.kalturaClient.doQueue();
    String resultText = resultXmlElement.getTextContent();
    return ParseUtils.parseInt(resultText);
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:12,代码来源:KalturaMediaService.java

示例6: unlike

import org.w3c.dom.Element; //导入方法依赖的package包/类
public boolean unlike(String entryId) throws KalturaApiException {
    KalturaParams kparams = new KalturaParams();
    kparams.add("entryId", entryId);
    this.kalturaClient.queueServiceCall("like_like", "unlike", kparams);
    if (this.kalturaClient.isMultiRequest())
        return false;
    Element resultXmlElement = this.kalturaClient.doQueue();
    String resultText = resultXmlElement.getTextContent();
    return ParseUtils.parseBool(resultText);
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:11,代码来源:KalturaLikeService.java

示例7: getUrl

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**  Get download URL for the asset     */
public String getUrl(String id, int storageId) throws KalturaApiException {
    KalturaParams kparams = new KalturaParams();
    kparams.add("id", id);
    kparams.add("storageId", storageId);
    this.kalturaClient.queueServiceCall("thumbasset", "getUrl", kparams);
    if (this.kalturaClient.isMultiRequest())
        return null;
    Element resultXmlElement = this.kalturaClient.doQueue();
    String resultText = resultXmlElement.getTextContent();
    return ParseUtils.parseString(resultText);
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:13,代码来源:KalturaThumbAssetService.java

示例8: proppatchResponseTest

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**
 * PROPPATCHの返却値のチェック関数.
 * @param doc 解析するXMLオブジェクト
 * @param resorce PROPPATCHを設定したリソースパス
 * @param map チェックするプロパティのKeyValue KeyとValueに値を入れれば値があることのチェック ValueをnullにするとKeyが無いことのチェック(removeの確認に使う)
 */
private void proppatchResponseTest(Element doc, String resorce, Map<String, String> map) {
    StringBuffer sb = new StringBuffer(resorce);
    sb.deleteCharAt(resorce.length() - 1);

    NodeList response = doc.getElementsByTagName("response");
    assertEquals(1, response.getLength());
    Element node = (Element) response.item(0);
    assertEquals(
            sb.toString(),
            node.getElementsByTagName("href").item(0).getFirstChild().getNodeValue());
    assertEquals(
            "HTTP/1.1 200 OK",
            node.getElementsByTagName("status").item(0).getFirstChild().getNodeValue());

    for (Iterator<String> it = map.keySet().iterator(); it.hasNext();) {
        Object key = it.next();
        Object value = map.get(key);
        String textContext = null;
        NodeList tmp = node.getElementsByTagName("prop").item(0).getChildNodes();
        for (int i = 0; i < tmp.getLength(); i++) {
            Node child = tmp.item(i);
            if (child instanceof Element) {
                Element childElement = (Element) child;
                if (childElement.getLocalName().equals(key)) {
                    textContext = childElement.getTextContent();
                    break;
                }
            }
        }
        assertEquals(value, textContext);
    }
}
 
开发者ID:personium,项目名称:personium-core,代码行数:39,代码来源:PropPatchTest.java

示例9: updateFirstChild

import org.w3c.dom.Element; //导入方法依赖的package包/类
private static boolean updateFirstChild(Element parentElement, String elementName, String value) {
    if (parentElement != null) {
        Element element = DomHelper.firstChild(parentElement, elementName);
        if (element != null) {
            String textContent = element.getTextContent();
            if (textContent == null || !value.equals(textContent)) {
                element.setTextContent(value);
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:fabric8-launcher,项目名称:launcher-backend,代码行数:14,代码来源:ChoosePipelineStep.java

示例10: count

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**  count cue point objects by filter     */
public int count(KalturaCuePointFilter filter) throws KalturaApiException {
    KalturaParams kparams = new KalturaParams();
    kparams.add("filter", filter);
    this.kalturaClient.queueServiceCall("cuepoint_cuepoint", "count", kparams);
    if (this.kalturaClient.isMultiRequest())
        return 0;
    Element resultXmlElement = this.kalturaClient.doQueue();
    String resultText = resultXmlElement.getTextContent();
    return ParseUtils.parseInt(resultText);
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:12,代码来源:KalturaCuePointService.java

示例11: parseWrapperStyle

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**
 * @param context
 * @param parent
 * @param e
 */
private void parseWrapperStyle(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
    //System.out.println("In handleWrapperStyleExtension: " + e.getNodeName());
    String val = e.getTextContent();
    if (val == null) {
        return;
    }
    if (val.equals("false") || val.equals("0")) {
        ((JAXWSBinding) parent).setEnableWrapperStyle(Boolean.FALSE);
    } else if (val.equals("true") || val.equals("1")) {
        ((JAXWSBinding) parent).setEnableWrapperStyle(Boolean.TRUE);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:JAXWSBindingExtensionHandler.java

示例12: getTime

import org.w3c.dom.Element; //导入方法依赖的package包/类
public int getTime() throws KalturaApiException {
    KalturaParams kparams = new KalturaParams();
    this.kalturaClient.queueServiceCall("system", "getTime", kparams);
    if (this.kalturaClient.isMultiRequest())
        return 0;
    Element resultXmlElement = this.kalturaClient.doQueue();
    String resultText = resultXmlElement.getTextContent();
    return ParseUtils.parseInt(resultText);
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:10,代码来源:KalturaSystemService.java

示例13: isLive

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**  New action delivering the status of a live stream (on-air/offline) if it is
possible     */
 public boolean isLive(String id, KalturaPlaybackProtocol protocol) throws KalturaApiException {
     KalturaParams kparams = new KalturaParams();
     kparams.add("id", id);
     kparams.add("protocol", protocol);
     this.kalturaClient.queueServiceCall("livestream", "isLive", kparams);
     if (this.kalturaClient.isMultiRequest())
         return false;
     Element resultXmlElement = this.kalturaClient.doQueue();
     String resultText = resultXmlElement.getTextContent();
     return ParseUtils.parseBool(resultText);
 }
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:14,代码来源:KalturaLiveStreamService.java

示例14: proppatchResponseTest

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**
 * PROPPATCHの返却値のチェック関数.
 * @param doc 解析するXMLオブジェクト
 * @param resorce PROPPATCHを設定したリソースパス
 * @param map チェックするプロパティのKeyValue KeyとValueに値を入れれば値があることのチェック ValueをnullにするとKeyが無いことのチェック(removeの確認に使う)
 */
private void proppatchResponseTest(Element doc, String resorce, Map<String, String> map) {
    NodeList response = doc.getElementsByTagName("response");
    assertEquals(1, response.getLength());
    Element node = (Element) response.item(0);
    assertEquals(
            resorce,
            node.getElementsByTagName("href").item(0).getFirstChild().getNodeValue());
    assertEquals(
            "HTTP/1.1 200 OK",
            node.getElementsByTagName("status").item(0).getFirstChild().getNodeValue());

    for (Iterator<String> it = map.keySet().iterator(); it.hasNext();) {
        Object key = it.next();
        Object value = map.get(key);
        String textContext = null;
        NodeList tmp = node.getElementsByTagName("prop").item(0).getChildNodes();
        for (int i = 0; i < tmp.getLength(); i++) {
            Node child = tmp.item(i);
            if (child instanceof Element) {
                Element childElement = (Element) child;
                if (childElement.getLocalName().equals(key)) {
                    textContext = childElement.getTextContent();
                    break;
                }
            }
        }
        assertEquals(value, textContext);
    }
}
 
开发者ID:personium,项目名称:personium-core,代码行数:36,代码来源:CollectionTest.java

示例15: getCurrentPermissions

import org.w3c.dom.Element; //导入方法依赖的package包/类
/**  Retrieves a list of permissions that apply to the current KS.     */
public String getCurrentPermissions() throws KalturaApiException {
    KalturaParams kparams = new KalturaParams();
    this.kalturaClient.queueServiceCall("permission", "getCurrentPermissions", kparams);
    if (this.kalturaClient.isMultiRequest())
        return null;
    Element resultXmlElement = this.kalturaClient.doQueue();
    String resultText = resultXmlElement.getTextContent();
    return ParseUtils.parseString(resultText);
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:11,代码来源:KalturaPermissionService.java


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