public static boolean isParticleOptional(XmlSchemaParticle particle) { return particle.getMinOccurs() == 0 && particle.getMaxOccurs() == 1; }
public static boolean isParticleOptional(XmlSchemaParticle particle) { return particle.getMinOccurs() == 0 && particle.getMaxOccurs() == 1; }
public static boolean isParticleOptional(XmlSchemaParticle particle) { return particle.getMinOccurs() == 0 && particle.getMaxOccurs() == 1; }
public static boolean isParticleOptional(XmlSchemaParticle particle) { return particle.getMinOccurs() == 0 && particle.getMaxOccurs() == 1; }
public static boolean isParticleOptional(XmlSchemaParticle particle) { return particle.getMinOccurs() == 0 && particle.getMaxOccurs() == 1; }
/** * Find whether a given particle is an array. The logic for deciding * whether a given particle is an array is depending on their minOccurs * and maxOccurs counts. If Maxoccurs is greater than one (1) then the * content is an array. * Also no higher level element will have the maxOccurs greater than one * * @param particle * @throws SchemaCompilationException */ private boolean isArray(XmlSchemaParticle particle) throws SchemaCompilationException { long minOccurs = particle.getMinOccurs(); long maxOccurs = particle.getMaxOccurs(); if (maxOccurs < minOccurs) { throw new SchemaCompilationException(); } else { return (maxOccurs > 1); } }
/** * Find whether a given particle is an array. The logic for deciding * whether a given particle is an array is depending on their minOccurs * and maxOccurs counts. If Maxoccurs is greater than one (1) then the * content is an array. * Also no higher level element will have the maxOccurs greater than one * * @param particle * @throws SchemaCompilationException */ private boolean isArray(XmlSchemaParticle particle) throws SchemaCompilationException { long minOccurs = particle.getMinOccurs(); long maxOccurs = particle.getMaxOccurs(); if (maxOccurs < minOccurs) { throw new SchemaCompilationException(); } else { return (maxOccurs > 1); } }
qname + ": type to be unwrapped must be a sequence"); if (particle.getMinOccurs() != 1 || particle.getMaxOccurs() != 1) { throw new RuntimeException("Cannot unwrap element " + qname +
qname + ": type to be unwrapped must be a sequence"); if (particle.getMinOccurs() != 1 || particle.getMaxOccurs() != 1) { throw new RuntimeException("Cannot unwrap element " + qname +
XmlSchemaParticle realParticle = sequenceParticle; elementInfo.setMinOccurs(sequenceParticle.getMinOccurs()); elementInfo.setMaxOccurs(sequenceParticle.getMaxOccurs()); if (sequenceParticle.getMinOccurs() == 0) { childParticle.setMinOccurs(0);