org.apache.xmlbeans.QNameSet类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(108)

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

QNameSet介绍

[英]This interface represents a lattice of finite and infinite sets of QNames. The lattice the minimal one that is closed under union, intersection, and inverse, and contains individual QNames as well as entire namespaces. Here is a summary of the two kinds of QNameSets:

  • A QNameSet can cover a finite set of namespaces, additionally including a finite set of QNames outside those namespaces, and with the exception of a finite set of QNames excluded from those namespaes:

  • excludedQNamesInIncludedURIs == the set of excluded QNames from coveredURIs namespaces

    • excludedURIs == null
    • includedURIs == the set of covered namespace URIs
    • includedQNamesInExcludedURIs == set of additional QNames outside coveredURIs namespaces
  • A QNameSet can cover all namespaces except for a finite number of excluded ones, additionally including a finite set of QNames within the excluded namespaces, and with the exception of a finite set of QNames outside the excluded namespaces:

  • excludedQNamesInIncludedURIs == the set of excluded QNames outside uncoveredURIs namespaces

    • excludedURIs == the set of uncovered namespace URIs
    • includedURIs == null
    • includedQNamesInExcludedURIs == set of additional QNames from uncoveredURIs namespaces

Notice that a finite set of QNames is a degenerate case of the first category outlined above:

  • A QnameSet can contain a finite number of QNames:

  • excludedQNamesInIncludedURIs == empty set

    • excludedURIs == null
    • includedURIs == empty set
    • includedQNamesInExcludedURIs == set of included QNames
      [中]这个接口代表一个有限和无限QName集合的晶格。格是在并集、交集和逆下闭合的最小格,包含单独的qname以及整个名称空间。以下是两种QNameset的摘要:
      *QNameSet可以覆盖一组有限的名称空间,另外还包括这些名称空间之外的一组有限的QNames,除了从这些名称空间中排除的一组有限的QNames之外:
      *excludedQNamesInIncludedURIs==从coveredURIs命名空间中排除的QNames集合
      *excludedURIs==null
      *IncludeDris==覆盖的命名空间URI集
      *IncludedQNamesIncludeDris==coveredURIs命名空间之外的一组附加QNames
      *QNameSet可以覆盖除有限数量的排除名称空间之外的所有名称空间,另外还包括排除名称空间内的有限QName集,以及排除名称空间外的有限QName集:
      *excludedQNamesInIncludedURIs==未经验证的名称空间之外被排除的QNames集合
      *excludedURIs==未覆盖的命名空间URI集
      *includedris==null
      *IncludedQNamesIncludeDris==来自uncoveredURIs命名空间的一组附加QName
      请注意,有限的QName集合是上述第一类的退化情况:
      *QnameSet可以包含有限数量的QName:
      *excludedQNamesInIncludedURIs==空集
      *excludedURIs==null
      *includedris==空集
      *IncludedQNamesIncludeDris==包含的QNames集合

代码示例

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

public boolean canStartWithElement(QName name)
  { return name != null && _startSet.contains(name); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

QNameSet readQNameSet()
{
  int flag = readShort();
  Set uriSet = new HashSet();
  int uriCount = readShort();
  for (int i = 0; i < uriCount; i++)
    uriSet.add(readString());
  Set qnameSet1 = new HashSet();
  int qncount1 = readShort();
  for (int i = 0; i < qncount1; i++)
    qnameSet1.add(readQName());
  Set qnameSet2 = new HashSet();
  int qncount2 = readShort();
  for (int i = 0; i < qncount2; i++)
    qnameSet2.add(readQName());
  if (flag == 1)
    return QNameSet.forSets(uriSet, null, qnameSet1, qnameSet2);
  else
    return QNameSet.forSets(null, uriSet, qnameSet2, qnameSet1);
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * True if the given set is a subset of this one.
 * @param set the set to test
 * @return true if this contains all QNames contained by the given set
 */
public boolean containsAll(QNameSetSpecification set)
{
  // a.contains(b) == a.inverse.isDisjoint(b)
  if (!_inverted && set.excludedURIs() != null)
    return false;
  
  return inverse().isDisjoint(set);
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * Returns a new QNameSet that is the inverse of this one.
 */
public QNameSet inverse()
{
  if (this == EMPTY)
    return ALL;
  if (this == ALL)
    return EMPTY;
  if (this == LOCAL)
    return NONLOCAL;
  if (this == NONLOCAL)
    return LOCAL;
  return new QNameSet(includedURIs(), excludedURIs(), includedQNamesInExcludedURIs(), excludedQNamesInIncludedURIs());
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

return NONLOCAL;
return new QNameSet(
    minSetCopy(excludedURIs),
    minSetCopy(includedURIs),
    minSetCopy(excludedQNamesInIncludedURIs),
    minSetCopy(includedQNamesInExcludedURIs));

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

if (!baseModel.getWildcardSet().contains(sAttr.getName()))
        state.error(XmlErrorCodes.COMPLEX_TYPE_RESTRICTION$ATTR_IN_BASE_WILDCARD_SET,
          new Object[] { QNameHelper.pretty(sAttr.getName()), QNameHelper.pretty(outerType.getName()) }, xsdattr);
else
  nsText = nsList.getStringValue();
QNameSet wcset = QNameSet.forWildcardNamespaceString(nsText, targetNamespace);
    continue; // ignore the extra wildcard
  else if (!baseModel.getWildcardSet().containsAll(wcset))
    result.setWildcardSet(wcset.union(result.getWildcardSet()));
    result.setWildcardProcess(wcprocess);
    result.setWildcardSet(wcset.intersect(result.getWildcardSet()));

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

if (!allContents.contains(target))
  return QNameSet.EMPTY;
    return QNameSet.singleton(target);
      if (childContents.contains(target))
        builder.addAll(computeNondelimitingElements(target, contentModel.getParticleChild(i), state));
      else if (childContents.contains(target))

代码示例来源:origin: org.apache.geronimo.framework/geronimo-deployment

protected void addBuilder(T builder) {
  QNameSet builderSpecQNames = builder.getSpecQNameSet();
  QNameSet builderPlanQNames = builder.getPlanQNameSet();
  if (builderSpecQNames == null) {
    throw new IllegalStateException("Builder " + builder + " is missing spec qnames");
  }
  if (builderPlanQNames == null) {
    throw new IllegalStateException("Builder " + builder + " is missing plan qnames");
  }
  if (!specQNames.isDisjoint(builderSpecQNames) && !planQNames.isDisjoint(builderPlanQNames)) {
    throw new IllegalArgumentException("Duplicate builderSpecQNames in builder set: " + builderSpecQNames + " and duplicate builderPlanQNames in builder set: " + builderPlanQNames);
  }
  try {
    specQNames = specQNames.union(builderSpecQNames);
    planQNames = planQNames.union(builderPlanQNames);
  } catch (NullPointerException e) {
    throw (IllegalArgumentException) new IllegalArgumentException("could not merge qnamesets for builder " + builder).initCause(e);
  }
  //really?
  XmlBeansUtil.registerSubstitutionGroupElements(builder.getBaseQName(), builderPlanQNames);
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-corba-builder

public QNameSet getPlanQNameSet() {
  return QNameSet.singleton(TSS_LINK_QNAME);
}

代码示例来源:origin: org.apache.geronimo.framework/geronimo-deployment

public static void unregisterSubstitutionGroupElements(QName substitutionGroup, QNameSet substitutions) {
  QNameSet oldSubstitutions = substitutionGroups.get(substitutionGroup);
  if (oldSubstitutions != null && substitutions != null) {
    QNameSet difference = oldSubstitutions.intersect(substitutions.inverse());
    substitutionGroups.put(substitutionGroup, difference);
  }
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

wcset = QNameSet.ALL;
else
  wcset = QNameSet.forWildcardNamespaceString(nslist.getStringValue(), targetNamespace);
sPart.setWildcardSet(wcset);
sPart.setWildcardProcess(translateWildcardProcess(parseAny.xgetProcessContents()));

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * Returns a QNameSet containing only the given QName.
 * @return the constructed QNameSet
 */
public static QNameSet singleton(QName name)
{
  return new QNameSet(null, Collections.EMPTY_SET, Collections.EMPTY_SET, Collections.singleton(name));
}

代码示例来源:origin: org.apache.geronimo.framework/geronimo-deployment

public static void registerSubstitutionGroupElements(QName substitutionGroup, QNameSet substitutions) {
  QNameSet oldSubstitutions = substitutionGroups.get(substitutionGroup);
  if (oldSubstitutions != null) {
    substitutions = oldSubstitutions.union(substitutions);
  }
  substitutionGroups.put(substitutionGroup, substitutions);
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * True if the parameter is a subset of this set.
 */
public boolean containsAll(QNameSetSpecification set)
{
  if (!_inverted && set.excludedURIs() != null)
    return false;
  
  return inverse().isDisjoint(set);
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

if (suspectSet.isDisjoint(part.getWildcardSet()))
  return;
result.put(part, part.getWildcardSet().intersect(suspectSet));
eliminate.addAll(part.getWildcardSet());
return;

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

private static boolean afterMapSubsumedByStartMap(Map startMap, Map afterMap)
{
  if (afterMap.size() > startMap.size())
    return false;
  
  if (afterMap.isEmpty())
    return true;
  
  for (Iterator i = startMap.keySet().iterator(); i.hasNext(); )
  {
    SchemaParticle part = (SchemaParticle)i.next();
    if (part.getParticleType() == SchemaParticle.WILDCARD)
    {
      if (afterMap.containsKey(part))
      {
        QNameSet startSet = (QNameSet)startMap.get(part);
        QNameSet afterSet = (QNameSet)afterMap.get(part);
        if (!startSet.containsAll(afterSet))
          return false;
      }
    }
    afterMap.remove(part);
    if (afterMap.isEmpty())
      return true;
  }
  return (afterMap.isEmpty());
}

代码示例来源:origin: com.github.pjfanning/xmlbeans

if (!baseModel.getWildcardSet().contains(sAttr.getName()))
        state.error(XmlErrorCodes.COMPLEX_TYPE_RESTRICTION$ATTR_IN_BASE_WILDCARD_SET,
          new Object[] { QNameHelper.pretty(sAttr.getName()), QNameHelper.pretty(outerType.getName()) }, xsdattr);
else
  nsText = nsList.getStringValue();
QNameSet wcset = QNameSet.forWildcardNamespaceString(nsText, targetNamespace);
    continue; // ignore the extra wildcard
  else if (!baseModel.getWildcardSet().containsAll(wcset))
    result.setWildcardSet(wcset.union(result.getWildcardSet()));
    result.setWildcardProcess(wcprocess);
    result.setWildcardSet(wcset.intersect(result.getWildcardSet()));

代码示例来源:origin: org.apache.xmlbeans/com.springsource.org.apache.xmlbeans

/**
 * Returns a new QNameSet that is the inverse of this one.
 */
public QNameSet inverse()
{
  if (this == EMPTY)
    return ALL;
  if (this == ALL)
    return EMPTY;
  if (this == LOCAL)
    return NONLOCAL;
  if (this == NONLOCAL)
    return LOCAL;
  return new QNameSet(includedURIs(), excludedURIs(), includedQNamesInExcludedURIs(), excludedQNamesInIncludedURIs());
}

代码示例来源:origin: com.github.pjfanning/xmlbeans

if (!allContents.contains(target))
  return QNameSet.EMPTY;
    return QNameSet.singleton(target);
      if (childContents.contains(target))
        builder.addAll(computeNondelimitingElements(target, contentModel.getParticleChild(i), state));
      else if (childContents.contains(target))

代码示例来源:origin: org.apache.geronimo.modules/geronimo-persistence-jpa20-builder

public QNameSet getPlanQNameSet() {
  return QNameSet.singleton(PERSISTENCE_QNAME);
}

相关文章