示例#1
0
 public void setFinal(final DerivationMethod derivation, final boolean enabled) {
   assertNotLocked();
   PreCondition.assertArgumentNotNull(derivation, "derivation");
   PreCondition.assertTrue(
       derivation.isExtension() || derivation.isRestriction(),
       "derivation (" + derivation + ") must be extension or restriction for a complex type");
   if (enabled) {
     m_final.add(derivation);
   } else {
     m_final.remove(derivation);
   }
 }
示例#2
0
 public boolean subtype(final PrimeType rhs) {
   PreCondition.assertArgumentNotNull(rhs, "type");
   switch (rhs.getKind()) {
     case CHOICE:
       {
         final PrimeChoiceType choiceType = (PrimeChoiceType) rhs;
         return subtype(choiceType.getLHS()) || subtype(choiceType.getRHS());
       }
       // case ANY_TYPE:
       // case COMPLEX:
       // {
       // final ComplexType complexType = (ComplexType)rhs;
       // return SchemaSupport.subtype(this, complexType);
       // }
     case ELEMENT:
       {
         @SuppressWarnings("unused")
         final ElementNodeType element = (ElementNodeType) rhs;
         return false;
       }
     default:
       {
         return false;
       }
   }
 }
 protected N parseEventReader(XMLEventReader reader, String systemId)
     throws IOException, XdmMarshalException {
   // this is probably working now.
   PreCondition.assertNotNull(reader, "reader");
   builder.reset();
   XmlEventVisitor visitor = new XmlEventVisitor(reader, builder);
   if (systemId != null) visitor.setSystemId(systemId);
   visitor.parse();
   return builder.getNode();
 }
示例#4
0
 public ComplexTypeImpl(
     final QName name,
     final boolean isNative,
     final boolean isAnonymous,
     final ScopeExtent scope,
     final Type baseType,
     final DerivationMethod derivation,
     final Map<QName, AttributeUse> attributeUses,
     final ContentType contentType,
     final Set<DerivationMethod> block,
     final AtomicType atoms) {
   super(PreCondition.assertArgumentNotNull(name, "name"), isAnonymous, scope, derivation);
   this.isNative = isNative;
   this.m_atoms = PreCondition.assertArgumentNotNull(atoms, "atoms");
   m_baseType = baseType; // PreCondition.assertArgumentNotNull(baseType, "baseType");
   m_contentType = PreCondition.assertArgumentNotNull(contentType, "contentType");
   m_block = PreCondition.assertArgumentNotNull(block, "block");
   m_blockUnmodifiable = Collections.unmodifiableSet(m_block);
   m_attributeUses = PreCondition.assertArgumentNotNull(attributeUses, "attributeUses");
   m_attributeWildcard = computeAttributeWildcard(baseType, derivation);
 }
 public N parse(Reader characterStream, String systemId) throws IOException, XdmMarshalException {
   PreCondition.assertNotNull(characterStream, "characterStream");
   try {
     XMLEventReader eventReader;
     if (systemId == null) {
       eventReader = ipf.createXMLEventReader(characterStream);
     } else {
       eventReader = ipf.createXMLEventReader(systemId.toString(), characterStream);
     }
     return parseEventReader(eventReader, systemId);
   } catch (XMLStreamException xse) {
     throw new XdmMarshalException(xse);
   }
 }
示例#6
0
 public AtomItem(A atom) {
   this.atom = PreCondition.assertNotNull(atom, "atom");
 }
示例#7
0
 public NodeItem(N node) {
   this.node = PreCondition.assertNotNull(node, "node");
 }
 public DefaultDocumentHandler(final FragmentBuilder<N> builder, final Model<N> model) {
   super(PreCondition.assertNotNull(model, "model"));
   this.builder = PreCondition.assertNotNull(builder, "builder");
   ipf = XMLInputFactory.newInstance();
   initIPF();
 }
 public DefaultDocumentHandler(ProcessingContext<N> context) {
   this(PreCondition.assertNotNull(context, "context").newFragmentBuilder(), context.getModel());
 }
 XmlNodeMutableContext(XmlNodeContext context) {
   this.context = PreCondition.assertNotNull(context, "context");
 }
 public XMLIdentityConstraint(final QName name, final XMLScope global) {
   super(global);
   this.name = PreCondition.assertArgumentNotNull(name);
 }
示例#12
0
 public void setContentType(final ContentType contentType) {
   assertNotLocked();
   m_contentType = PreCondition.assertArgumentNotNull(contentType, "name");
 }
示例#13
0
 public boolean isFinal(final DerivationMethod derivation) {
   PreCondition.assertArgumentNotNull(derivation, "derivation");
   return m_final.contains(derivation);
 }
 public ValidationItemIterator(final ValidationItem pendingItem) {
   m_pendingItem = PreCondition.assertArgumentNotNull(pendingItem);
 }
 public XMLIdentityConstraint(
     final QName name, final XMLScope global, final SrcFrozenLocation location) {
   super(global, location);
   this.name = PreCondition.assertArgumentNotNull(name);
 }
示例#16
0
 public AtomicUrTypeImpl(final String W3C_XML_SCHEMA_NS_URI, final SimpleUrType baseType) {
   this.m_name = new QName(W3C_XML_SCHEMA_NS_URI, "anyAtomicType");
   this.m_baseType = PreCondition.assertArgumentNotNull(baseType, "baseType");
 }
示例#17
0
 public XmlDuration(final int months, final BigDecimal seconds) {
   this.months = months;
   this.seconds = PreCondition.assertArgumentNotNull(seconds, "seconds");
 }