org.eclipse.xsd.XSDElementDeclaration.getName()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(133)

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

XSDElementDeclaration.getName介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) {
  XSDElementDeclaration element = (XSDElementDeclaration) e.next();
  if (ft.getName().equals(element.getName())) {
    type = element.getTypeDefinition();
    break;
    for (Iterator c = children.iterator(); c.hasNext(); ) {
      XSDElementDeclaration ce = (XSDElementDeclaration) c.next();
      if (at.getName().equals(ce.getName())) {
        found = true;
        if (ce.getContainer() instanceof XSDParticle) {

代码示例来源:origin: geotools/geotools

public ElementEncodeExecutor(
    Object object,
    XSDElementDeclaration element,
    Document document,
    Logger logger,
    NamespaceSupport namespaces) {
  this.object = object;
  this.element = element;
  this.document = document;
  this.logger = logger;
  this.namespaces = namespaces;
  //		if ( element.getTargetNamespace() != null ) {
  encoding = document.createElementNS(element.getTargetNamespace(), element.getName());
  //		}
  //		else {
  //			encoding = document.createElementNS(
  //				element.getSchema().getTargetNamespace(), element.getName()
  //			);
  //		}
}

代码示例来源:origin: geotools/geotools

protected void buildElementIndex() {
  elementIndex = new HashMap();
  for (int i = 0; i < schemas.length; i++) {
    XSDSchema schema = schemas[i];
    for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) {
      XSDElementDeclaration element = (XSDElementDeclaration) e.next();
      QName qName = new QName(element.getTargetNamespace(), element.getName());
      elementIndex.put(qName, element);
    }
  }
}

代码示例来源:origin: geotools/geotools

protected final XSDTypeDefinition findGlobalElementXSDType(XSDElementDeclaration element) {
  for (Iterator i = schema.getElementDeclarations().iterator(); i.hasNext();) {
    XSDElementDeclaration e = (XSDElementDeclaration) i.next();
    if (element.getName().equals( e.getName() ) && (element.getTargetNamespace() == null || 
      element.getTargetNamespace().equals( e.getTargetNamespace() ) ) ) {
      return e.getType();
    }
  }
  return null; 
}

代码示例来源:origin: geotools/geotools

/**
 * Searches <code>schema</code> for an element which matches <code>name</code>.
 *
 * @param schema The schema
 * @param name The element to search for
 * @return The element declaration, or null if it could not be found.
 */
public static XSDElementDeclaration getElementDeclaration(XSDSchema schema, QName name) {
  for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) {
    XSDElementDeclaration element = (XSDElementDeclaration) e.next();
    if (element.getTargetNamespace().equals(name.getNamespaceURI())) {
      if (element.getName().equals(name.getLocalPart())) {
        return element;
      }
    }
  }
  return null;
}

代码示例来源:origin: geotools/geotools

/**
 * Returns the particle for an element declaration that is part of a type.
 *
 * @param type The type definition.
 * @param name The naem of the child element declaration.
 * @param includeParents Flag to control wether parent types are included.
 * @return The particle representing the element declaration, or <code>null</code> if it could
 *     not be found.
 */
public static final XSDParticle getChildElementParticle(
    XSDTypeDefinition type, String name, boolean includeParents) {
  List particles = getChildElementParticles(type, includeParents);
  for (Iterator p = particles.iterator(); p.hasNext(); ) {
    XSDParticle particle = (XSDParticle) p.next();
    XSDElementDeclaration element = (XSDElementDeclaration) particle.getContent();
    if (element.isElementDeclarationReference()) {
      element.getResolvedElementDeclaration();
    }
    if (name.equals(element.getName())) {
      return particle;
    }
  }
  return null;
}

代码示例来源:origin: geotools/geotools

/** Returns the name of the element represented by the particle as a QName. */
public static QName getParticleName(XSDParticle particle) {
  XSDElementDeclaration content = (XSDElementDeclaration) particle.getContent();
  if (content.isElementDeclarationReference()) {
    content = content.getResolvedElementDeclaration();
  }
  return new QName(content.getTargetNamespace(), content.getName());
}

代码示例来源:origin: geotools/geotools

for (Iterator itr = elements.iterator(); itr.hasNext();) {
  XSDElementDeclaration element = (XSDElementDeclaration)itr.next();
  if (element.getName() == null) continue;
  if (!ns.equals(element.getTargetNamespace())) continue;
stringBuffer.append(element.getName());
stringBuffer.append(TEXT_18);
stringBuffer.append(ns);
stringBuffer.append(TEXT_19);
stringBuffer.append(element.getName());
stringBuffer.append(TEXT_20);

代码示例来源:origin: geotools/geotools

child = child.getResolvedElementDeclaration();
if (child.getName().equals(partContent.getName())
    && (child.getTargetNamespace() == null
        ? partContent.getTargetNamespace() == null

代码示例来源:origin: geotools/geotools

childName = new QName(child.getTargetNamespace(), child.getName());
} else if (parent.getTargetNamespace() != null) {
  childName = new QName(parent.getTargetNamespace(), child.getName());
} else if (parent.getType().getTargetNamespace() != null) {
  childName =
      new QName(
          parent.getType().getTargetNamespace(), child.getName());
} else {
  childName = new QName(null, child.getName());

代码示例来源:origin: geotools/geotools

private AttributeDescriptor createAttributeDescriptor(
    final XSDElementDeclaration elemDecl,
    int minOccurs,
    int maxOccurs,
    CoordinateReferenceSystem crs) {
  String targetNamespace = elemDecl.getTargetNamespace();
  String name = elemDecl.getName();
  Name elemName = Types.typeName(targetNamespace, name);
  AttributeType type = getTypeOf(elemDecl, crs);
  boolean nillable = elemDecl.isNillable();
  Object defaultValue = null;
  AttributeDescriptor descriptor =
      createAttributeDescriptor(
          type, crs, elemName, minOccurs, maxOccurs, nillable, defaultValue);
  descriptor.getUserData().put(XSDElementDeclaration.class, elemDecl);
  return descriptor;
}

代码示例来源:origin: geotools/geotools

if (se == null
    || (Utilities.equals(el.getTargetNamespace(), se.getTargetNamespace())
        && Utilities.equals(el.getName(), se.getName()))) {
  toremove.add(i);

代码示例来源:origin: geotools/geotools

if (featureType.getDescriptor(attribute.getName()) == null) {
  continue;
Object attributeValue = feature.getAttribute(attribute.getName());
properties.add(new Object[] {particle, attributeValue});

代码示例来源:origin: geotools/geotools

XSDElementDeclaration element = (XSDElementDeclaration ) e.next();
if ( element.getAnonymousTypeDefinition() != null ) {
  element.getAnonymousTypeDefinition().setName( "_" + element.getName() );
  anonymous.add( element.getAnonymousTypeDefinition() );
    element.getAnonymousTypeDefinition().setName( type.getName() + "_" + element.getName() );
    anonymous.add( element.getAnonymousTypeDefinition() );

代码示例来源:origin: geotools/geotools

contentName =
      QualifiedName.build(
          content.getTargetNamespace(), content.getName(), prefix);
} else {
  contentName =
      new QualifiedName(content.getTargetNamespace(), content.getName());
int idx = getNameIndex(content.getName(), attributeDescriptors);
attribute.attributeIndex = idx;
if (idx != -1) {
  if (contentType == null || content.getName() == null) {
    throw new IllegalArgumentException("Could not find non annonymous type");

代码示例来源:origin: geotools/geotools

@Override
  public Object apply(Object particle) {
    XSDElementDeclaration attr =
        (XSDElementDeclaration)
            ((XSDParticle)
                    particle)
                .getContent();
    if (attr
        .isElementDeclarationReference()) {
      attr =
          attr
              .getResolvedElementDeclaration();
    }
    return new NameImpl(
        attr.getTargetNamespace(),
        attr.getName());
  }
})

代码示例来源:origin: geotools/geotools

QName subQName = new QName(sub.getTargetNamespace(), sub.getName());
Handler handler = getChildHandlerInternal(subQName);

代码示例来源:origin: geotools/geotools

new NameImpl(element.getTargetNamespace(), element.getName()),
    minOccurs, maxOccurs, isNillable, null);
properties.add(ad);

代码示例来源:origin: geotools/geotools

fType = ftCache.get(new NameImpl(decl.getTargetNamespace(), decl.getName()));

代码示例来源:origin: geotools/geotools

throw (IOException) e;
String msg = "Error parsing feature type for " + elementDecl.getName();
throw (IOException) new IOException(msg).initCause(e);

相关文章

微信公众号

最新文章

更多

XSDElementDeclaration类方法