本文整理汇总了Java中org.w3c.dom.Element.getChildNodes方法的典型用法代码示例。如果您正苦于以下问题:Java Element.getChildNodes方法的具体用法?Java Element.getChildNodes怎么用?Java Element.getChildNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.w3c.dom.Element
的用法示例。
在下文中一共展示了Element.getChildNodes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: KalturaPartnerUsageListResponse
import org.w3c.dom.Element; //导入方法依赖的package包/类
public KalturaPartnerUsageListResponse(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("total")) {
this.total = ParseUtils.parseObject(KalturaVarPartnerUsageItem.class, aNode);
continue;
} else if (nodeName.equals("objects")) {
this.objects = ParseUtils.parseArray(KalturaVarPartnerUsageItem.class, aNode);
continue;
} else if (nodeName.equals("totalCount")) {
this.totalCount = ParseUtils.parseInt(txt);
continue;
}
}
}
示例2: parse
import org.w3c.dom.Element; //导入方法依赖的package包/类
protected void parse(Element element) {
if (XMLUtils.findChildNode(element, Node.ELEMENT_NODE) != null) {
this.type = ELEMENT_COMPLEX_TYPE;
}
else if (element.hasAttributes()) {
this.type = ELEMENT_COMPLEX_TYPE;
}
else {
this.type = ELEMENT_SIMPLE_TYPE;
this.value = element.getTextContent().trim();
}
NamedNodeMap map = element.getAttributes();
for (int i=0; i<map.getLength(); i++) {
add(map.item(i));
}
NodeList list = element.getChildNodes();
for (int i=0; i<list.getLength(); i++) {
add(list.item(i));
}
}
示例3: KalturaYahooSyndicationFeed
import org.w3c.dom.Element; //导入方法依赖的package包/类
public KalturaYahooSyndicationFeed(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("category")) {
this.category = KalturaYahooSyndicationFeedCategories.get(ParseUtils.parseString(txt));
continue;
} else if (nodeName.equals("adultContent")) {
this.adultContent = KalturaYahooSyndicationFeedAdultValues.get(ParseUtils.parseString(txt));
continue;
} else if (nodeName.equals("feedDescription")) {
this.feedDescription = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("feedLandingPage")) {
this.feedLandingPage = ParseUtils.parseString(txt);
continue;
}
}
}
示例4: getDom
import org.w3c.dom.Element; //导入方法依赖的package包/类
public static SemLit getDom(Element e, NameFactory nf) {
SemLit sem = new SemDom();
int argnum = 1;
NodeList l = e.getChildNodes();
for (int i = 0; i < l.getLength(); i++) {
Node n = l.item(i);
if (n.getNodeType() == Node.ELEMENT_NODE) {
Element el = (Element) n;
if (el.getTagName().equals("sym")) {
Value semval = getSingleValue(el, nf);
switch (argnum) {
case 1:
((SemDom) sem).setArg1(semval);
argnum++;
break;
case 2:
((SemDom) sem).setArg2(semval);
argnum++;
break;
default:// skip
}
}
}
}
return sem;
}
示例5: KalturaIndexAdvancedFilter
import org.w3c.dom.Element; //导入方法依赖的package包/类
public KalturaIndexAdvancedFilter(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("indexIdGreaterThan")) {
this.indexIdGreaterThan = ParseUtils.parseInt(txt);
continue;
}
}
}
示例6: KalturaAccessControl
import org.w3c.dom.Element; //导入方法依赖的package包/类
public KalturaAccessControl(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("isDefault")) {
this.isDefault = KalturaNullableBoolean.get(ParseUtils.parseInt(txt));
continue;
} else if (nodeName.equals("restrictions")) {
this.restrictions = ParseUtils.parseArray(KalturaBaseRestriction.class, aNode);
continue;
} else if (nodeName.equals("containsUnsuportedRestrictions")) {
this.containsUnsuportedRestrictions = ParseUtils.parseBool(txt);
continue;
}
}
}
示例7: getFirstChildElement
import org.w3c.dom.Element; //导入方法依赖的package包/类
/** Gets the fist child of the given name, or null. */
public static Element getFirstChildElement( Element parent, String nsUri, String localPart ) {
NodeList children = parent.getChildNodes();
for( int i=0; i<children.getLength(); i++ ) {
Node item = children.item(i);
if(!(item instanceof Element )) continue;
if(nsUri.equals(item.getNamespaceURI())
&& localPart.equals(item.getLocalName()) )
return (Element)item;
}
return null;
}
示例8: childElements
import org.w3c.dom.Element; //导入方法依赖的package包/类
private List<Element> childElements(final Element parentNode, final String elementName) {
final List<Element> ret = new ArrayList<>();
final NodeList nodes = parentNode.getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
if (nodes.item(i).getNodeType() != Node.ELEMENT_NODE) {
continue;
}
final Element element = (Element)nodes.item(i);
if (elementName.equals(element.getTagName())) {
ret.add(element);
}
}
return ret;
}
示例9: KalturaThumbParamsBaseFilter
import org.w3c.dom.Element; //导入方法依赖的package包/类
public KalturaThumbParamsBaseFilter(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("formatEqual")) {
this.formatEqual = KalturaContainerFormat.get(ParseUtils.parseString(txt));
continue;
}
}
}
示例10: KalturaConvartableJobData
import org.w3c.dom.Element; //导入方法依赖的package包/类
public KalturaConvartableJobData(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("srcFileSyncLocalPath")) {
this.srcFileSyncLocalPath = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("actualSrcFileSyncLocalPath")) {
this.actualSrcFileSyncLocalPath = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("srcFileSyncRemoteUrl")) {
this.srcFileSyncRemoteUrl = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("engineVersion")) {
this.engineVersion = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("flavorParamsOutputId")) {
this.flavorParamsOutputId = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("flavorParamsOutput")) {
this.flavorParamsOutput = ParseUtils.parseObject(KalturaFlavorParamsOutput.class, aNode);
continue;
} else if (nodeName.equals("mediaInfoId")) {
this.mediaInfoId = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("currentOperationSet")) {
this.currentOperationSet = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("currentOperationIndex")) {
this.currentOperationIndex = ParseUtils.parseInt(txt);
continue;
}
}
}
示例11: DisplayName
import org.w3c.dom.Element; //导入方法依赖的package包/类
protected DisplayName(Element element) {
logger.debug("Constructor - entry");
NodeList nodeList = element.getChildNodes();
for (int n = 0; n < nodeList.getLength(); n++) {
Node node = nodeList.item(n);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element childElement = (Element) node;
logger.trace("Unrecognized child node: '"
+ childElement.getNodeName() + "' ("
+ this.getClass().getName() + ")");
} else if (node.getNodeType() == Node.TEXT_NODE) {
this.setValue(node.getNodeValue());
}
}
NamedNodeMap namedNodeMap = element.getAttributes();
if (namedNodeMap != null) {
for (int a = 0; a < namedNodeMap.getLength(); a++) {
Attr attributeNode = (Attr) namedNodeMap.item(a);
if ("NPT".equals(attributeNode.getName())) {
setMatchOnNPT("1".equals(attributeNode.getValue()));
} else {
logger.trace("Unrecognized attribute: '" + attributeNode.getName() + "' (" + this.getClass().getName() + ")");
}
}
}
logger.debug("Constructor - exit");
}
示例12: KalturaUserRole
import org.w3c.dom.Element; //导入方法依赖的package包/类
public KalturaUserRole(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("name")) {
this.name = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("description")) {
this.description = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("status")) {
this.status = KalturaUserRoleStatus.get(ParseUtils.parseInt(txt));
continue;
} else if (nodeName.equals("partnerId")) {
this.partnerId = ParseUtils.parseInt(txt);
continue;
} else if (nodeName.equals("permissionNames")) {
this.permissionNames = ParseUtils.parseString(txt);
continue;
} else if (nodeName.equals("tags")) {
this.tags = 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;
}
}
}
示例13: readXmlElement
import org.w3c.dom.Element; //导入方法依赖的package包/类
/**
* This method will read a tree of elements and their attributes
*
* @param element the root element of the tree
*/
private void readXmlElement(
LinkedList<String> currentElementPath,
Element element ) {
//append this node element to the current path
currentElementPath.add(element.getNodeName());
NodeList childNodes = element.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node childNode = childNodes.item(i);
if (childNode.getNodeType() == Node.ELEMENT_NODE) {
readXmlElement(currentElementPath, (Element) childNode);
}
}
//read all attributes
NamedNodeMap attributes = element.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Attr attribute = (Attr) attributes.item(i);
String propertyName = getCurrentXmlElementPath(currentElementPath) + attribute.getName();
String propertyValue = attribute.getValue();
//put in the properties table
properties.put(propertyName, propertyValue);
log.debug("Added property with name '" + propertyName + "' and value '" + propertyValue + "'");
}
//after we are done with the node, remove it from the path
currentElementPath.removeLast();
}
示例14: configure
import org.w3c.dom.Element; //导入方法依赖的package包/类
@Override
public void configure(Element element) throws Exception {
super.configure(element);
String version = element.getAttribute("version");
if (version == null) {
String s = XMLUtils.prettyPrintDOM(element);
EngineException ee = new EngineException("Unable to find version number for the database object \"" + getName() + "\".\nXML data: " + s);
throw ee;
}
if (VersionUtils.compare(version, "4.6.0") < 0) {
NodeList properties = element.getElementsByTagName("property");
Element propValue = (Element) XMLUtils.findNodeByAttributeValue(properties, "name", "level");
Node xmlNode = null;
NodeList nl = propValue.getChildNodes();
int len_nl = nl.getLength();
for (int j = 0 ; j < len_nl ; j++) {
xmlNode = nl.item(j);
if (xmlNode.getNodeType() == Node.ELEMENT_NODE) {
String sLevel = (String) XMLUtils.readObjectFromXml((Element) xmlNode);
if (sLevel.equals("warning")) setLevel(Level.WARN.toString());
else if (sLevel.equals("message")) setLevel(Level.INFO.toString());
else if (sLevel.equals("debug")) setLevel(Level.DEBUG.toString());
else if (sLevel.equals("debug2")) setLevel(Level.TRACE.toString());
else if (sLevel.equals("debug3")) setLevel(Level.TRACE.toString());
continue;
}
}
hasChanged = true;
Engine.logBeans.warn("(Transaction) The object \"" + getName() + "\" has been updated to version 4.6.0");
}
}
示例15: KalturaAmazonS3StorageProfile
import org.w3c.dom.Element; //导入方法依赖的package包/类
public KalturaAmazonS3StorageProfile(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("filesPermissionInS3")) {
this.filesPermissionInS3 = KalturaAmazonS3StorageProfileFilesPermissionLevel.get(ParseUtils.parseString(txt));
continue;
}
}
}