本文整理匯總了Java中org.w3c.dom.Node.getTextContent方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.getTextContent方法的具體用法?Java Node.getTextContent怎麽用?Java Node.getTextContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.w3c.dom.Node
的用法示例。
在下文中一共展示了Node.getTextContent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: KalturaRule
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaRule(Element node) throws KalturaApiException {
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("message")) {
this.message = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("actions")) {
this.actions = ParseUtils.parseArray(KalturaAccessControlAction.class, aNode);
continue;
} else if (nodeName.equals("conditions")) {
this.conditions = ParseUtils.parseArray(KalturaCondition.class, aNode);
continue;
} else if (nodeName.equals("contexts")) {
this.contexts = ParseUtils.parseArray(KalturaAccessControlContextTypeHolder.class, aNode);
continue;
} else if (nodeName.equals("stopProcessing")) {
this.stopProcessing = ParseUtils.parseBool(txt);
continue;
}
}
}
示例2: KalturaExtendingItemMrssParameter
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaExtendingItemMrssParameter(Element node) throws KalturaApiException {
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("xpath")) {
this.xpath = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("identifier")) {
this.identifier = ParseUtils.parseObject(KalturaObjectIdentifier.class, aNode);
continue;
} else if (nodeName.equals("extensionMode")) {
this.extensionMode = KalturaMrssExtensionMode.get(ParseUtils.parseInt(txt));
continue;
}
}
}
示例3: KalturaAssetParamsResourceContainer
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaAssetParamsResourceContainer(Element node) throws KalturaApiException {
super(node);
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("resource")) {
this.resource = ParseUtils.parseObject(KalturaContentResource.class, aNode);
continue;
} else if (nodeName.equals("assetParamsId")) {
this.assetParamsId = ParseUtils.parseInt(txt);
continue;
}
}
}
示例4: KalturaSearch
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaSearch(Element node) throws KalturaApiException {
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("keyWords")) {
this.keyWords = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("searchSource")) {
this.searchSource = KalturaSearchProviderType.get(ParseUtils.parseInt(txt));
continue;
} else if (nodeName.equals("mediaType")) {
this.mediaType = KalturaMediaType.get(ParseUtils.parseInt(txt));
continue;
} else if (nodeName.equals("extraData")) {
this.extraData = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("authData")) {
this.authData = ParseUtils.parseString(txt);
continue;
}
}
}
示例5: KalturaSystemPartnerOveragedLimit
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaSystemPartnerOveragedLimit(Element node) throws KalturaApiException {
super(node);
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("overagePrice")) {
this.overagePrice = ParseUtils.parseFloat(txt);
continue;
} else if (nodeName.equals("overageUnit")) {
this.overageUnit = ParseUtils.parseFloat(txt);
continue;
}
}
}
示例6: KalturaImageFlavorParamsOutput
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaImageFlavorParamsOutput(Element node) throws KalturaApiException {
super(node);
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("densityWidth")) {
this.densityWidth = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("densityHeight")) {
this.densityHeight = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("sizeWidth")) {
this.sizeWidth = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("sizeHeight")) {
this.sizeHeight = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("depth")) {
this.depth = ParseUtils.parseInt(txt);
continue;
}
}
}
示例7: decodeChild
import org.w3c.dom.Node; //導入方法依賴的package包/類
/**
* Reads the specified child into the given object.
*/
protected void decodeChild(mxCodec dec, Node child, Object obj) {
String fieldname = getFieldName(((Element) child).getAttribute("as"));
if (fieldname == null || !isExcluded(obj, fieldname, child, false)) {
Object template = getFieldTemplate(obj, fieldname, child);
Object value = null;
if (child.getNodeName().equals("add")) {
value = ((Element) child).getAttribute("value");
if (value == null) {
value = child.getTextContent();
}
} else {
value = dec.decode(child, template);
// System.out.println("Decoded " + child.getNodeName() + "."
// + fieldname + "=" + value);
}
addObjectValue(obj, fieldname, value, template);
}
}
示例8: KalturaBaseEntryFilter
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaBaseEntryFilter(Element node) throws KalturaApiException {
super(node);
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("freeText")) {
this.freeText = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("isRoot")) {
this.isRoot = KalturaNullableBoolean.get(ParseUtils.parseInt(txt));
continue;
} else if (nodeName.equals("categoriesFullNameIn")) {
this.categoriesFullNameIn = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("categoryAncestorIdIn")) {
this.categoryAncestorIdIn = ParseUtils.parseString(txt);
continue;
}
}
}
示例9: KalturaCaptionParams
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaCaptionParams(Element node) throws KalturaApiException {
super(node);
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("language")) {
this.language = KalturaLanguage.get(ParseUtils.parseString(txt));
continue;
} else if (nodeName.equals("isDefault")) {
this.isDefault = KalturaNullableBoolean.get(ParseUtils.parseInt(txt));
continue;
} else if (nodeName.equals("label")) {
this.label = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("format")) {
this.format = KalturaCaptionType.get(ParseUtils.parseString(txt));
continue;
} else if (nodeName.equals("sourceParamsId")) {
this.sourceParamsId = ParseUtils.parseInt(txt);
continue;
}
}
}
示例10: KalturaSearchOperator
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaSearchOperator(Element node) throws KalturaApiException {
super(node);
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("type")) {
this.type = KalturaSearchOperatorType.get(ParseUtils.parseInt(txt));
continue;
} else if (nodeName.equals("items")) {
this.items = ParseUtils.parseArray(KalturaSearchItem.class, aNode);
continue;
}
}
}
示例11: KalturaUrlResource
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaUrlResource(Element node) throws KalturaApiException {
super(node);
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("url")) {
this.url = ParseUtils.parseString(txt);
continue;
}
}
}
示例12: test
import org.w3c.dom.Node; //導入方法依賴的package包/類
public static String test(NodeList list) {
Node node = list.item(0);
return "["+node.getNodeName() + ":" + node.getTextContent()+"]";
}
示例13: KalturaConversionProfileAssetParamsListResponse
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaConversionProfileAssetParamsListResponse(Element node) throws KalturaApiException {
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("objects")) {
this.objects = ParseUtils.parseArray(KalturaConversionProfileAssetParams.class, aNode);
continue;
} else if (nodeName.equals("totalCount")) {
this.totalCount = ParseUtils.parseInt(txt);
continue;
}
}
}
開發者ID:ITYug,項目名稱:kaltura-ce-sakai-extension,代碼行數:16,代碼來源:KalturaConversionProfileAssetParamsListResponse.java
示例14: performNodeValueChecks
import org.w3c.dom.Node; //導入方法依賴的package包/類
/**
* Performs all attribute value checks contained in the validation profile. If the validation has failed (some of the attributes
* specified in the validation profile do not match their specified values or regex) {@link WrongNodeValue} or
* {@link InvalidNodeValue} is thrown.
*
* @param sipPath path to the SIP
* @param validationProfileDoc document with the validation profile
* @param validationProfileId id of the validation profile
* @throws IOException if some of the files addressed from the validation profile is not found
* @throws XPathExpressionException if there is an error in the XPath expression
* @throws SAXException if the validationProfileDoc cannot be parsed
* @throws ParserConfigurationException
*/
private void performNodeValueChecks(String sipPath, Document validationProfileDoc, String validationProfileId)
throws IOException, ParserConfigurationException, XPathExpressionException, SAXException {
XPath xPath = XPathFactory.newInstance().newXPath();
NodeList nodes = (NodeList) xPath.compile("/profile/rule/nodeCheck")
.evaluate(validationProfileDoc, XPathConstants.NODESET);
for (int i = 0; i< nodes.getLength(); i++) {
Element element = (Element) nodes.item(i);
String filePath = element.getElementsByTagName("filePath").item(0).getTextContent();
String absoluteFilePath = sipPath + filePath;
String expression = element.getElementsByTagName("xPath").item(0).getTextContent();
String actualValue = ValidationChecker.findWithXPath(new FileInputStream(absoluteFilePath), expression).item(0).getTextContent();
Node valueElement = element.getElementsByTagName("value").item(0);
if (valueElement != null) {
String expectedValue = valueElement.getTextContent();
// compare with value
if (!expectedValue.equals(actualValue)) {
log.info("Validation of SIP with profile " + validationProfileId + " failed. Expected value of node at path \"" +
expression + "\" is " + expectedValue + ". Actual value is " + actualValue + ".");
throw new WrongNodeValue(expectedValue, actualValue, absoluteFilePath, expression); }
} else {
//compare with regex
Node regexElement = element.getElementsByTagName("regex").item(0);
String regex = regexElement.getTextContent();
Pattern pattern = Pattern.compile(regex);
Matcher m = pattern.matcher(actualValue);
if (!m.matches()) {
log.info("Validation of SIP with profile " + validationProfileId + " failed. Value " + actualValue + " of node at " +
"path \"" + expression + "\" does not match regex " + regex + ".");
throw new InvalidNodeValue(regex, actualValue, absoluteFilePath, expression); }
}
}
}
示例15: KalturaAccessControlProfile
import org.w3c.dom.Node; //導入方法依賴的package包/類
public KalturaAccessControlProfile(Element node) throws KalturaApiException {
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node aNode = childNodes.item(i);
String nodeName = aNode.getNodeName();
String txt = aNode.getTextContent();
if (nodeName.equals("id")) {
this.id = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("partnerId")) {
this.partnerId = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("name")) {
this.name = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("systemName")) {
this.systemName = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("description")) {
this.description = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("createdAt")) {
this.createdAt = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("updatedAt")) {
this.updatedAt = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("isDefault")) {
this.isDefault = KalturaNullableBoolean.get(ParseUtils.parseInt(txt));
continue;
} else if (nodeName.equals("rules")) {
this.rules = ParseUtils.parseArray(KalturaRule.class, aNode);
continue;
}
}
}