gpt4 book ai didi

org.metawidget.util.XmlUtils.getLocalName()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 22:17:05 28 4
gpt4 key购买 nike

本文整理了Java中org.metawidget.util.XmlUtils.getLocalName()方法的一些代码示例,展示了XmlUtils.getLocalName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlUtils.getLocalName()方法的具体详情如下:
包路径:org.metawidget.util.XmlUtils
类名称:XmlUtils
方法名:getLocalName

XmlUtils.getLocalName介绍

[英]Gets the localName of the given node. Or the nodeName if the localName returns null (as we've seen it do on Android)
[中]获取给定节点的localName。或者如果localName返回null(正如我们在Android上看到的那样),则使用nodeName

代码示例

代码示例来源:origin: org.metawidget.modules/metawidget-core

/**
 * Gets the next sibling to the given element with the given name.
 *
 * @return the next sibling, or null if no such sibling
 */
public static Element getSiblingNamed( Element element, String name ) {
  if ( element == null ) {
    return null;
  }
  Node node = element;
  while ( true ) {
    node = node.getNextSibling();
    if ( node == null ) {
      return null;
    }
    if ( !( node instanceof Element ) ) {
      continue;
    }
    if ( name.equals( getLocalName( node ) ) ) {
      return (Element) node;
    }
  }
}

代码示例来源:origin: org.metawidget.modules/metawidget-all

/**
 * Gets the next sibling to the given element with the given name.
 *
 * @return the next sibling, or null if no such sibling
 */
public static Element getSiblingNamed( Element element, String name ) {
  if ( element == null ) {
    return null;
  }
  Node node = element;
  while ( true ) {
    node = node.getNextSibling();
    if ( node == null ) {
      return null;
    }
    if ( !( node instanceof Element ) ) {
      continue;
    }
    if ( name.equals( getLocalName( node ) ) ) {
      return (Element) node;
    }
  }
}

代码示例来源:origin: org.metawidget.modules/metawidget-core

if ( name.equals( getLocalName( child ) ) ) {
  children = child.getChildNodes();
  continue outer;

代码示例来源:origin: org.metawidget.modules/metawidget-all

if ( name.equals( getLocalName( child ) ) ) {
  children = child.getChildNodes();
  continue outer;

代码示例来源:origin: org.metawidget.modules/metawidget-core

if ( ACTION.equals( getLocalName( element ) ) && !element.hasAttribute( "type" ) ) {
  if ( jsonBuilder.length() > 0 ) {
    jsonBuilder.insert( 0, "," );

代码示例来源:origin: org.metawidget.modules/metawidget-all

if ( ACTION.equals( getLocalName( element ) ) && !element.hasAttribute( "type" ) ) {
  if ( jsonBuilder.length() > 0 ) {
    jsonBuilder.insert( 0, "," );

代码示例来源:origin: org.metawidget.modules/metawidget-all

if ( SIMPLE_TYPE.equals( XmlUtils.getLocalName( topLevel ) ) ) {
  return topLevel;
if ( COMPLEX_TYPE.equals( XmlUtils.getLocalName( topLevel ) ) ) {
  if ( SIMPLE_TYPE.equals( XmlUtils.getLocalName( complexType ) ) ) {
    return topLevel;
  if ( !COMPLEX_TYPE.equals( XmlUtils.getLocalName( complexType ) ) ) {
    throw InspectorException.newException( "Unexpected child node '" + XmlUtils.getLocalName( complexType ) + "'" );
String sequenceLocalName = XmlUtils.getLocalName( sequence );
  sequenceLocalName = XmlUtils.getLocalName( sequence );

代码示例来源:origin: org.metawidget.modules/metawidget-all

if ( "any".equals( XmlUtils.getLocalName( toInspectToUse ) ) ) {
  return null;
if ( COMPLEX_TYPE.equals( XmlUtils.getLocalName( toInspectToUse ) ) ) {

代码示例来源:origin: org.metawidget.modules/metawidget-all

private void inspectElement( Element element, Map<String, String> attributes ) {
  // Type
  if ( element.hasAttribute( TYPE ) ) {
    attributes.put( TYPE, element.getAttribute( TYPE ) );
  } else {
    // Type inferred from nested complexType or simpleType
    Element complexType = XmlUtils.getChildNamed( element, COMPLEX_TYPE );
    if ( complexType != null ) {
      Element simpleContent = XmlUtils.getChildNamed( complexType, SIMPLE_CONTENT );
      if ( simpleContent != null ) {
        inspectExtension( simpleContent, attributes );
        inspectRestriction( simpleContent, attributes );
      }
    } else if ( SIMPLE_TYPE.equals( XmlUtils.getLocalName( element ) ) ) {
      inspectRestriction( element, attributes );
    } else {
      Element simpleType = XmlUtils.getChildNamed( element, SIMPLE_TYPE );
      if ( simpleType != null ) {
        inspectRestriction( simpleType, attributes );
      }
    }
  }
  // Required
  String notNull = element.getAttribute( "minOccurs" );
  if ( !"".equals( notNull ) && Integer.parseInt( notNull ) > 0 ) {
    attributes.put( REQUIRED, TRUE );
  }
}

代码示例来源:origin: org.metawidget.modules/metawidget-all

if ( SIMPLE_TYPE.equals( XmlUtils.getLocalName( toInspectToUse ) ) ) {
if ( SIMPLE_CONTENT.equals( XmlUtils.getLocalName( toInspectToUse ) ) ) {
if ( COMPLEX_CONTENT.equals( XmlUtils.getLocalName( toInspectToUse ) ) ) {
  Element baseSequence = XmlUtils.getFirstChildElement( baseElement );
  if ( COMPLEX_CONTENT.equals( XmlUtils.getLocalName( baseSequence ) ) ) {
    inspectTraits( baseSequence, toAddTo );
    return;
  if ( "anyAttribute".equals( XmlUtils.getLocalName( baseSequence ) ) ) {
    return;
  if ( !SEQUENCE.equals( XmlUtils.getLocalName( baseSequence ) ) ) {
    throw InspectorException.newException( "Unexpected child node '" + XmlUtils.getLocalName( baseSequence ) + "'" );
  if ( !SEQUENCE.equals( XmlUtils.getLocalName( toInspectToUse ) ) ) {
    throw InspectorException.newException( "Unexpected child node '" + XmlUtils.getLocalName( toInspectToUse ) + "'" );

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com