gpt4 book ai didi

org.deegree.commons.xml.stax.XMLStreamReaderWrapper.next()方法的使用及代码示例

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

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

XMLStreamReaderWrapper.next介绍

暂无

代码示例

代码示例来源:origin: deegree/deegree3

/**
 * Creates a new {@link StreamFeatureCollection} from the given {@link GMLStreamReader}.
 * 
 * @param fid
 * @param ft
 * @param featureReader
 * @param xmlStream
 * @param crs
 * @throws XMLStreamException
 */
StreamFeatureCollection( String fid, FeatureCollectionType ft, GMLFeatureReader featureReader,
             XMLStreamReaderWrapper xmlStream, ICRS crs ) throws XMLStreamException {
  this.fid = fid;
  this.ft = ft;
  this.featureReader = featureReader;
  this.xmlStream = xmlStream;
  xmlStream.next();
  declIter = ft.getPropertyDeclarations().iterator();
  activeDecl = declIter.next();
  propOccurences = 0;
  activeCRS = crs;
}

代码示例来源:origin: deegree/deegree3

/**
 * Skips all events that belong to the current element (including descendant elements), so that the
 * <code>XMLStreamReader</code> cursor points at the corresponding <code>END_ELEMENT</code> event.
 * 
 * @throws XMLStreamException
 */
public void skipElement()
            throws XMLStreamException {
  int openElements = 1;
  while ( openElements > 0 ) {
    // this should not be necessary, but IS
    if ( !hasNext() ) {
      throw new NoSuchElementException();
    }
    int event = next();
    if ( event == END_ELEMENT ) {
      openElements--;
    } else if ( event == START_ELEMENT ) {
      openElements++;
    }
  }
}

代码示例来源:origin: deegree/deegree3

private Feature readFeatureArray()
            throws XMLParsingException, XMLStreamException, UnknownCRSException {
  Feature feature = null;
  if ( xmlStream.getEventType() == START_ELEMENT ) {
    feature = featureReader.parseFeature( xmlStream, activeCRS );
  }
  if ( xmlStream.next() == END_ELEMENT ) {
    LOG.debug( "End of feature array property encountered." );
    featureArrayMode = false;
    propOccurences++;
  }
  return feature;
}

代码示例来源:origin: deegree/deegree3

/**
 * Not piped to wrapped reader, because AXIOM provided reader (withoutCaching) behaves strange here.
 */
@Override
public String getElementText()
            throws XMLStreamException {
  if ( getEventType() != XMLStreamConstants.START_ELEMENT ) {
    throw new XMLStreamException( "parser must be on START_ELEMENT to read next text", getLocation() );
  }
  int eventType = next();
  StringBuilder content = new StringBuilder();
  while ( eventType != XMLStreamConstants.END_ELEMENT ) {
    if ( eventType == XMLStreamConstants.CHARACTERS || eventType == XMLStreamConstants.CDATA
       || eventType == XMLStreamConstants.SPACE || eventType == XMLStreamConstants.ENTITY_REFERENCE ) {
      content.append( getText() );
    } else if ( eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
          || eventType == XMLStreamConstants.COMMENT ) {
      // skipping
    } else if ( eventType == XMLStreamConstants.END_DOCUMENT ) {
      throw new XMLStreamException( "unexpected end of document when reading element text content",
                     getLocation() );
    } else if ( eventType == XMLStreamConstants.START_ELEMENT ) {
      throw new XMLStreamException( "element text content may not contain START_ELEMENT", getLocation() );
    } else {
      throw new XMLStreamException( "Unexpected event type " + eventType, getLocation() );
    }
    eventType = next();
  }
  return content.toString();
}

代码示例来源:origin: deegree/deegree3

/**
 * Starts the validation.
 * 
 * @throws XMLStreamException
 * @throws UnknownCRSException
 */
public void validateGeometries()
            throws XMLStreamException, UnknownCRSException {
  while ( xmlStream.getEventType() != END_DOCUMENT ) {
    if ( xmlStream.isStartElement() ) {
      if ( gmlStream.isGeometryElement() ) {
        validateGeometryElement();
      }
    }
    xmlStream.next();
  }
}

代码示例来源:origin: deegree/deegree3

private TypedObjectNode parseComplexXMLElement( XMLStreamReaderWrapper xmlStream, ICRS crs )
            throws NoSuchElementException, XMLStreamException, XMLParsingException, UnknownCRSException {
  QName elName = xmlStream.getName();
  LOG.debug( "Parsing complex XML element " + elName + " (without schema information)" );
  if ( gmlStreamReader.getGeometryReader().isGeometryElement( xmlStream ) ) {
    return gmlStreamReader.getGeometryReader().parse( xmlStream );
  } else if ( schema.getFeatureType( elName ) != null ) {
    return gmlStreamReader.getFeatureReader().parseFeature( xmlStream, crs );
  }
  Map<QName, PrimitiveValue> attrs = parseAttributes( xmlStream );
  List<TypedObjectNode> children = new ArrayList<TypedObjectNode>();
  int eventType = 0;
  while ( ( eventType = xmlStream.next() ) != END_ELEMENT ) {
    if ( eventType == START_ELEMENT ) {
      TypedObjectNode child = parseGenericXMLElement( xmlStream, null, crs );
      children.add( child );
    } else if ( eventType == CDATA || eventType == CHARACTERS ) {
      // mixed content -> use string as primitive type
      String s = xmlStream.getText();
      if ( !s.trim().isEmpty() ) {
        children.add( new PrimitiveValue( s ) );
      }
    }
  }
  return new GenericXMLElement( xmlStream.getName(), null, attrs, children );
}

代码示例来源:origin: deegree/deegree3

while ( ( eventType = xmlStream.next() ) != END_ELEMENT ) {
  if ( eventType == START_ELEMENT ) {
    QName childElName = xmlStream.getName();
while ( ( eventType = xmlStream.next() ) != END_ELEMENT ) {
  if ( eventType == CDATA || eventType == CHARACTERS ) {
    PrimitiveValue pb = new PrimitiveValue( xmlStream.getText(),
while ( ( eventType = xmlStream.next() ) != END_ELEMENT ) {
  if ( eventType == START_ELEMENT ) {
    QName childElName = xmlStream.getName();

代码示例来源:origin: deegree/deegree3

StringBuffer text = new StringBuffer();
QName childElName = null;
xmlStream.next();
while ( !xmlStream.isStartElement() && !xmlStream.isEndElement() ) {
  if ( xmlStream.isCharacters() ) {
    text.append( xmlStream.getText() );
  xmlStream.next();

代码示例来源:origin: deegree/deegree3

xmlStream.next();
return feature;

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