Codota Logo
QName.getLocalPart
Code IndexAdd Codota to your IDE (free)

How to use
getLocalPart
method
in
javax.xml.namespace.QName

Best Java code snippets using javax.xml.namespace.QName.getLocalPart (Showing top 20 results out of 13,311)

Refine searchRefine arrow

  • QName.getNamespaceURI
  • QName.getPrefix
  • Iterator.hasNext
  • Iterator.next
  • QName.<init>
  • List.add
  • StartElement.getAttributes
  • Common ways to obtain QName
private void myMethod () {
QName q =
  • Codota IconString namespaceURI;String localPart;new QName(namespaceURI, localPart)
  • Codota IconString namespaceURI;String localPart;String prefix;new QName(namespaceURI, localPart, prefix)
  • Codota IconString localPart;new QName(localPart)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

/**
 * Convert a {@code QName} to a qualified name, as used by DOM and SAX.
 * The returned string has a format of {@code prefix:localName} if the
 * prefix is set, or just {@code localName} if not.
 * @param qName the {@code QName}
 * @return the qualified name
 */
protected String toQualifiedName(QName qName) {
  String prefix = qName.getPrefix();
  if (!StringUtils.hasLength(prefix)) {
    return qName.getLocalPart();
  }
  else {
    return prefix + ":" + qName.getLocalPart();
  }
}
origin: spring-projects/spring-framework

@Override
protected void startElementInternal(QName name, Attributes attributes,
    Map<String, String> namespaceMapping) throws XMLStreamException {
  this.streamWriter.writeStartElement(name.getPrefix(), name.getLocalPart(), name.getNamespaceURI());
  for (Map.Entry<String, String> entry : namespaceMapping.entrySet()) {
    String prefix = entry.getKey();
    String namespaceUri = entry.getValue();
    this.streamWriter.writeNamespace(prefix, namespaceUri);
    if (XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
      this.streamWriter.setDefaultNamespace(namespaceUri);
    }
    else {
      this.streamWriter.setPrefix(prefix, namespaceUri);
    }
  }
  for (int i = 0; i < attributes.getLength(); i++) {
    QName attrName = toQName(attributes.getURI(i), attributes.getQName(i));
    if (!isNamespaceDeclaration(attrName)) {
      this.streamWriter.writeAttribute(attrName.getPrefix(), attrName.getNamespaceURI(),
          attrName.getLocalPart(), attributes.getValue(i));
    }
  }
}
origin: wildfly/wildfly

  static Element of(QName qName) {
    QName name;
    if (qName.getNamespaceURI().equals("")) {
      name = new QName(NAMESPACE_1_0, qName.getLocalPart());
    } else {
      name = qName;
    }
    final Element element = elements.get(name);
    return element == null ? UNKNOWN : element;
  }
}
origin: spring-projects/spring-framework

private Attributes getAttributes(StartElement event) {
  AttributesImpl attributes = new AttributesImpl();
  for (Iterator i = event.getAttributes(); i.hasNext();) {
    Attribute attribute = (Attribute) i.next();
    QName qName = attribute.getName();
    String namespace = qName.getNamespaceURI();
    if (namespace == null || !hasNamespacesFeature()) {
      namespace = "";
      type = "CDATA";
    attributes.addAttribute(namespace, qName.getLocalPart(), toQualifiedName(qName), type, attribute.getValue());
    for (Iterator i = event.getNamespaces(); i.hasNext();) {
      Namespace namespace = (Namespace) i.next();
      String prefix = namespace.getPrefix();
      String namespaceUri = namespace.getNamespaceURI();
origin: hibernate/hibernate-orm

private StartElement withNamespace(StartElement startElement) {
  // otherwise, wrap the start element event to provide a default namespace mapping
  final List<Namespace> namespaces = new ArrayList<Namespace>();
  namespaces.add( xmlEventFactory.createNamespace( "", namespaceUri ) );
  Iterator<?> originalNamespaces = startElement.getNamespaces();
  while ( originalNamespaces.hasNext() ) {
    namespaces.add( (Namespace) originalNamespaces.next() );
  }
  return xmlEventFactory.createStartElement(
      new QName( namespaceUri, startElement.getName().getLocalPart() ),
      startElement.getAttributes(),
      namespaces.iterator()
  );
}
origin: hibernate/hibernate-orm

  private List<Attribute> updateElementAttributes(StartElement startElement) {
    // adjust the version attribute
    List<Attribute> newElementAttributeList = new ArrayList<Attribute>();
    Iterator<?> existingAttributesIterator = startElement.getAttributes();
    while ( existingAttributesIterator.hasNext() ) {
      Attribute attribute = (Attribute) existingAttributesIterator.next();
      if ( VERSION_ATTRIBUTE_NAME.equals( attribute.getName().getLocalPart() ) ) {
        if ( !DEFAULT_VERSION.equals( attribute.getName().getPrefix() ) ) {
          newElementAttributeList.add(
              xmlEventFactory.createAttribute(
                  attribute.getName(),
                  DEFAULT_VERSION
              )
          );
        }
      }
      else {
        newElementAttributeList.add( attribute );
      }
    }
    return newElementAttributeList;
  }
}
origin: geotools/geotools

@Override
public Collection<GeometryOperand> getGeometryOperands() {
  List<GeometryOperand> geometryOperands = new ArrayList<GeometryOperand>();
  if (getGeometryOperands2() != null) {
    for (GeometryOperandType go : getGeometryOperands2().getGeometryOperand()) {
      geometryOperands.add(GeometryOperand.get(go.getName().getNamespaceURI(), go.getName().getLocalPart()));
    }
  }
  return geometryOperands;
}
origin: geotools/geotools

private Coordinate[] parseLineStringInternal(int dimension, CoordinateReferenceSystem crs)
    throws XmlPullParserException, IOException {
  final QName lineElementName = new QName(parser.getNamespace(), parser.getName());
  final QName coordsName = new QName(parser.getNamespace(), parser.getName());
  String tagName = parser.getName();
  if (GML.pos.equals(coordsName)) {
    do {
      point = parseCoordList(dimension, crs);
      coords.add(point[0]);
      parser.nextTag();
      tagName = parser.getName();
      eventType = parser.getEventType();
    } while (eventType == START_TAG && GML.pos.getLocalPart().equals(tagName));
    do {
      point = parseCoord();
      coords.add(point);
      parser.nextTag();
      tagName = parser.getName();
      eventType = parser.getEventType();
    } while (eventType == START_TAG && GML.coord.getLocalPart().equals(tagName));
        "Expected posList or pos inside LinearRing: " + tagName);
  parser.require(END_TAG, lineElementName.getNamespaceURI(), lineElementName.getLocalPart());
  return lineCoords;
origin: geoserver/geoserver

  Catalog catalog)
  throws IOException {
String prefix = qName.getPrefix();
String name = qName.getLocalPart();
String uri = qName.getNamespaceURI();
featureType.getKeywords().add(new Keyword(name));
featureType.setEnabled(true);
featureType.setProjectionPolicy(
origin: apache/hbase

@Override
public String toString() {
 StringBuilder sb = new StringBuilder();
 sb.append("{ NAME=> '");
 sb.append(name);
 sb.append('\'');
 for (Map.Entry<QName,Object> e: attrs.entrySet()) {
  sb.append(", ");
  sb.append(e.getKey().getLocalPart());
  sb.append(" => '");
  sb.append(e.getValue().toString());
  sb.append('\'');
 }
 sb.append(", COLUMNS => [ ");
 Iterator<ColumnSchemaModel> i = columns.iterator();
 while (i.hasNext()) {
  ColumnSchemaModel family = i.next();
  sb.append(family.toString());
  if (i.hasNext()) {
   sb.append(',');
  }
  sb.append(' ');
 }
 sb.append("] }");
 return sb.toString();
}
origin: pentaho/pentaho-kettle

void setFieldInSObject( SObject sobjPass, XmlObject element ) {
 Iterator<XmlObject> children = element.getChildren();
 String name = element.getName().getLocalPart();
 if ( !children.hasNext() ) {
  sobjPass.setSObjectField( name, element.getValue() );
 } else {
  SObject child = new SObject();
  child.setName( new QName( name ) );
  while ( children.hasNext() ) {
   setFieldInSObject( child, children.next() );
  }
  sobjPass.setSObjectField( name, child );
 }
}
origin: com.sun.xml.bind/jaxb-impl

public TypeReference(QName tagName, Type type, Annotation... annotations) {
  if(tagName==null || type==null || annotations==null) {
    String nullArgs = "";
    if(tagName == null)     nullArgs = "tagName";
    if(type == null)        nullArgs += (nullArgs.length() > 0 ? ", type" : "type");
    if(annotations == null) nullArgs += (nullArgs.length() > 0 ? ", annotations" : "annotations");
    Messages.ARGUMENT_CANT_BE_NULL.format(nullArgs);
    
    throw new IllegalArgumentException(Messages.ARGUMENT_CANT_BE_NULL.format(nullArgs));
  }
  this.tagName = new QName(tagName.getNamespaceURI().intern(), tagName.getLocalPart().intern(), tagName.getPrefix());
  this.type = type;
  this.annotations = annotations;
}
origin: hibernate/hibernate-orm

private StartElement transform(StartElement startElement) {
  String elementName = startElement.getName().getLocalPart();
  // use the start element to determine whether we have a persistence.xml or orm.xml
  if ( START_ELEMENT_TO_NAMESPACE_URI.containsKey( elementName ) ) {
    currentDocumentNamespaceUri = START_ELEMENT_TO_NAMESPACE_URI.get( elementName );
  }
  List<Attribute> newElementAttributeList = updateElementAttributes( startElement );
  List<Namespace> newNamespaceList = updateElementNamespaces( startElement );
  // create the new element
  return xmlEventFactory.createStartElement(
      new QName( currentDocumentNamespaceUri, startElement.getName().getLocalPart() ),
      newElementAttributeList.iterator(),
      newNamespaceList.iterator()
  );
}
origin: spring-projects/spring-framework

@Override
@Nullable
public String getAttributeValue(@Nullable String namespaceURI, String localName) {
  for (int i = 0; i < getAttributeCount(); i++) {
    QName name = getAttributeName(i);
    if (name.getLocalPart().equals(localName) &&
        (namespaceURI == null || name.getNamespaceURI().equals(namespaceURI))) {
      return getAttributeValue(i);
    }
  }
  return null;
}
origin: spring-projects/spring-framework

private void handleEndElement(EndElement endElement) throws SAXException {
  if (getContentHandler() != null) {
    QName qName = endElement.getName();
    if (hasNamespacesFeature()) {
      getContentHandler().endElement(qName.getNamespaceURI(), qName.getLocalPart(), toQualifiedName(qName));
      for (Iterator i = endElement.getNamespaces(); i.hasNext();) {
        Namespace namespace = (Namespace) i.next();
        endPrefixMapping(namespace.getPrefix());
      }
    }
    else {
      getContentHandler().endElement("", "", toQualifiedName(qName));
    }
  }
}
origin: hibernate/hibernate-orm

final List<Namespace> targetNamespaces = new ArrayList<Namespace>();
if ( "".equals( startElement.getName().getNamespaceURI() ) ) {
  targetNamespaces.add( xmlEventFactory.createNamespace( MappingXsdSupport.INSTANCE.hbmXsd().getNamespaceUri() ) );
while ( originalNamespaces.hasNext() ) {
  Namespace namespace = originalNamespaces.next();
  if ( NAMESPACE_URIS_TO_MAP.contains( namespace.getNamespaceURI() ) ) {
  targetNamespaces.add( namespace );
    new QName( MappingXsdSupport.INSTANCE.hbmXsd().getNamespaceUri(), startElement.getName().getLocalPart() ),
    startElement.getAttributes(),
    targetNamespaces.iterator()
);
origin: geotools/geotools

@Override
public Collection<GeometryOperand> getGeometryOperands() {        
  List<GeometryOperand> geometryOperands = new ArrayList<GeometryOperand>();
  if (getGeometryOperands2() != null) {
    for (GeometryOperandType go : getGeometryOperands2().getGeometryOperand()) {
      geometryOperands.add(GeometryOperand.get(go.getName().getNamespaceURI(), go.getName().getLocalPart()));
    }
  }
  return geometryOperands;
}
origin: geotools/geotools

private Coordinate[] parseLineStringInternal(int dimension, CoordinateReferenceSystem crs)
    throws XmlPullParserException, IOException {
  final QName lineElementName = new QName(parser.getNamespace(), parser.getName());
  final QName coordsName = new QName(parser.getNamespace(), parser.getName());
  String tagName = parser.getName();
  if (GML.pos.equals(coordsName)) {
    do {
      point = parseCoordList(dimension);
      coords.add(point[0]);
      parser.nextTag();
      tagName = parser.getName();
      eventType = parser.getEventType();
    } while (eventType == START_TAG && tagName == GML.pos.getLocalPart());
    do {
      point = parseCoord();
      coords.add(point);
      parser.nextTag();
      tagName = parser.getName();
      eventType = parser.getEventType();
    } while (eventType == START_TAG && GML.coord.getLocalPart().equals(tagName));
        "Expected posList or pos inside LinearRing: " + tagName);
  parser.require(END_TAG, lineElementName.getNamespaceURI(), lineElementName.getLocalPart());
  return lineCoords;
origin: org.jdom/jdom

if (filter.includeElement(depth, qn.getLocalPart(), 
    Namespace.getNamespace(qn.getPrefix(), qn.getNamespaceURI()))) {
  ret.add(processPrunableElement(factory, stream, depth, filter));
} else {
  final int back = depth;
  ret.add(DTDParser.parse(stream.getText(), factory));
  ret.add(factory.cdata(text));
origin: pentaho/pentaho-kettle

for ( Iterator<WsdlOperation> itr = listeOperations.iterator(); itr.hasNext(); ) {
 WsdlOperation op = itr.next();
 wOperation.add( op.getOperationQName().getLocalPart() );
 if ( op.getOperationQName().getLocalPart().equals( text ) ) {
  wOperation.setText( text );
javax.xml.namespaceQNamegetLocalPart

Javadoc

Get the local part of this QName.

Popular methods of QName

  • <init>
    Constructor for the QName.
  • getNamespaceURI
    Gets the Namespace URI for this QName
  • equals
    Tests this QName for equality with another object. If the given object is not a QName or is null the
  • getPrefix
    Gets the prefix for this QName
  • toString
    Returns a string representation of this QName
  • valueOf
    Returns a QName holding the value of the specified String. The string must be in the form returned b
  • hashCode
    Returns a hash code value for this QName object. The hash code is based on both the localPart and na

Popular in Java

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • getExternalFilesDir (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JFileChooser (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now