org.apache.xmlbeans.QNameSet.isDisjoint()方法的使用及代码示例

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

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

QNameSet.isDisjoint介绍

[英]True if the given set is disjoint from this one.
[中]如果给定集合与此集合不相交,则为True。

代码示例

代码示例来源: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

/**
 * 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

private static boolean nsSubset(SchemaParticle baseModel, SchemaParticle derivedModel, Collection errors, XmlObject context) {
  // nsSubset is called when base: ANY, derived: ANY
  assert baseModel.getParticleType() == SchemaParticle.WILDCARD;
  assert derivedModel.getParticleType() == SchemaParticle.WILDCARD;
  boolean nsSubset = false;
  // For a wildcard particle to be a �valid restriction� of another wildcard particle all of the following must be true:
  // 1 R's occurrence range must be a valid restriction of B's occurrence range as defined by Occurrence Range OK (�3.9.6).
  if (occurrenceRangeOK(baseModel, derivedModel, errors, context)) {
    // 2 R's {namespace constraint} must be an intensional subset of B's {namespace constraint} as defined
    // by Wildcard Subset (�3.10.6).
    if (baseModel.getWildcardSet().inverse().isDisjoint(derivedModel.getWildcardSet())) {
      nsSubset = true;
    } else {
      nsSubset = false;
      errors.add(XmlError.forObject(XmlErrorCodes.PARTICLE_DERIVATION_NS_SUBST$WILDCARD_SUBSET,
        new Object[] { printParticle(derivedModel), printParticle(baseModel) }, context));
    }
  } else {
    nsSubset = false;
    // error already produced by occurrenceRangeOK
    //errors.add(XmlError.forObject(formatNSIsNotSubsetError(baseModel, derivedModel), context));
  }
  return nsSubset;
}

代码示例来源:origin: org.apache.xmlbeans/com.springsource.org.apache.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/com.springsource.org.apache.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: com.github.pjfanning/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: com.github.pjfanning/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.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.xmlbeans/com.springsource.org.apache.xmlbeans

private static boolean nsSubset(SchemaParticle baseModel, SchemaParticle derivedModel, Collection errors, XmlObject context) {
  // nsSubset is called when base: ANY, derived: ANY
  assert baseModel.getParticleType() == SchemaParticle.WILDCARD;
  assert derivedModel.getParticleType() == SchemaParticle.WILDCARD;
  boolean nsSubset = false;
  // For a wildcard particle to be a �valid restriction� of another wildcard particle all of the following must be true:
  // 1 R's occurrence range must be a valid restriction of B's occurrence range as defined by Occurrence Range OK (�3.9.6).
  if (occurrenceRangeOK(baseModel, derivedModel, errors, context)) {
    // 2 R's {namespace constraint} must be an intensional subset of B's {namespace constraint} as defined
    // by Wildcard Subset (�3.10.6).
    if (baseModel.getWildcardSet().inverse().isDisjoint(derivedModel.getWildcardSet())) {
      nsSubset = true;
    } else {
      nsSubset = false;
      errors.add(XmlError.forObject(XmlErrorCodes.PARTICLE_DERIVATION_NS_SUBST$WILDCARD_SUBSET,
        new Object[] { printParticle(derivedModel), printParticle(baseModel) }, context));
    }
  } else {
    nsSubset = false;
    // error already produced by occurrenceRangeOK
    //errors.add(XmlError.forObject(formatNSIsNotSubsetError(baseModel, derivedModel), context));
  }
  return nsSubset;
}

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

private static boolean nsSubset(SchemaParticle baseModel, SchemaParticle derivedModel, Collection errors, XmlObject context) {
  // nsSubset is called when base: ANY, derived: ANY
  assert baseModel.getParticleType() == SchemaParticle.WILDCARD;
  assert derivedModel.getParticleType() == SchemaParticle.WILDCARD;
  boolean nsSubset = false;
  // For a wildcard particle to be a �valid restriction� of another wildcard particle all of the following must be true:
  // 1 R's occurrence range must be a valid restriction of B's occurrence range as defined by Occurrence Range OK (�3.9.6).
  if (occurrenceRangeOK(baseModel, derivedModel, errors, context)) {
    // 2 R's {namespace constraint} must be an intensional subset of B's {namespace constraint} as defined
    // by Wildcard Subset (�3.10.6).
    if (baseModel.getWildcardSet().inverse().isDisjoint(derivedModel.getWildcardSet())) {
      nsSubset = true;
    } else {
      nsSubset = false;
      errors.add(XmlError.forObject(XmlErrorCodes.PARTICLE_DERIVATION_NS_SUBST$WILDCARD_SUBSET,
        new Object[] { printParticle(derivedModel), printParticle(baseModel) }, context));
    }
  } else {
    nsSubset = false;
    // error already produced by occurrenceRangeOK
    //errors.add(XmlError.forObject(formatNSIsNotSubsetError(baseModel, derivedModel), context));
  }
  return nsSubset;
}

相关文章