public static boolean isParticleArray(XmlSchemaParticle particle) { return particle.getMaxOccurs() > 1; }
public static boolean isParticleArray(XmlSchemaParticle particle) { return particle.getMaxOccurs() > 1; }
public static boolean isParticleArray(XmlSchemaParticle particle) { return particle.getMaxOccurs() > 1; }
public static boolean isParticleArray(XmlSchemaParticle particle) { return particle.getMaxOccurs() > 1; }
public static boolean isParticleArray(XmlSchemaParticle particle) { return 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; }
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); } }
if (particle.getMaxOccurs() > 1) {
private void visit(XmlSchema xmlSchema, XmlSchemaParticle particle, final int level, final ArrayNode avroFields) { if (particle.getMaxOccurs() > 1) { /* TODO find a way to handle occuring sequences and alls */ log.warn("Schema object at line " + particle.getLineNumber() + " contains a multi-occurence particle that is ignored"); } if (particle instanceof XmlSchemaSequence) { XmlSchemaSequence sequence = (XmlSchemaSequence) particle; for (XmlSchemaSequenceMember member : sequence.getItems()) { visit(xmlSchema, member, level, avroFields); } } else if (particle instanceof XmlSchemaAll) { XmlSchemaAll all = (XmlSchemaAll) particle; for (XmlSchemaAllMember member : all.getItems()) { visit(xmlSchema, member, level, avroFields); } } else { /* TODO process other particle types of interest */ /* TODO find a way to handle xsd:attribute */ log.warn("Schema object does not contain a sequence or all element at line " + particle.getLineNumber()); } }
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 +
elementInfo.setMaxOccurs(sequenceParticle.getMaxOccurs()); XmlSchemaChoice choice = (XmlSchemaChoice)sequenceParticle; if (sequenceParticle.getMaxOccurs() > 1) { Message message = new Message("GROUP_ELEMENT_MULTI_OCCURS", LOG, sequenceParticle .getClass().getSimpleName()); XmlSchemaSequence nestedSequence = (XmlSchemaSequence)sequenceParticle; if (sequenceParticle.getMaxOccurs() > 1) { Message message = new Message("SEQUENCE_ELEMENT_MULTI_OCCURS", LOG, sequenceParticle .getClass().getSimpleName());