@Test public void testOccuresZeroOrMore() throws Exception { xmlParserMock.zeroOrMore("name", xmlElementProcessorMock); replay(xmlParserMock); XmlType parent = createMock(XmlType.class); replay(parent); xmlElementProcessorMock.parentLinkAdd(parent, "name"); replay(xmlElementProcessorMock); XmlProcessorElement child = new XmlProcessorElement(xmlElementProcessorMock, "name", OccursEnum.zeroOrMore); child.process(xmlParserMock, parent); verify(parent); }
public void process( @Nonnull final XmlParser xmlParser, @Nonnull final XmlType xmlTypeParent) throws Exception { if (elementOccurs.equals(OccursEnum.required)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.required(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.oneOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.oneOrMore(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.optional)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.optional(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.zeroOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.zeroOrMore(elementName, elementProcessor); } }
XmlProcessorElement { public void process( @Nonnull final XmlParser xmlParser, @Nonnull final XmlType xmlTypeParent) throws Exception { if (elementOccurs.equals(OccursEnum.required)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.required(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.oneOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.oneOrMore(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.optional)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.optional(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.zeroOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.zeroOrMore(elementName, elementProcessor); } } }
XmlProcessorElement { public void process( @Nonnull final XmlParser xmlParser, @Nonnull final XmlType xmlTypeParent) throws Exception { if (elementOccurs.equals(OccursEnum.required)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.required(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.oneOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.oneOrMore(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.optional)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.optional(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.zeroOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.zeroOrMore(elementName, elementProcessor); } } XmlProcessorElement(
      @Nonnull final XmlProcessorType elementProcessorParam,
      @Nonnull final String elementNameParam,
      @Nonnull final OccursEnum elementOccursParam); }
XmlProcessorElement { public void process( @Nonnull final XmlParser xmlParser, @Nonnull final XmlType xmlTypeParent) throws Exception { if (elementOccurs.equals(OccursEnum.required)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.required(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.oneOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.oneOrMore(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.optional)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.optional(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.zeroOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.zeroOrMore(elementName, elementProcessor); } } XmlProcessorElement(
      @Nonnull final XmlProcessorType elementProcessorParam,
      @Nonnull final String elementNameParam,
      @Nonnull final OccursEnum elementOccursParam); void process(
      @Nonnull final XmlParser xmlParser,
      @Nonnull final XmlType xmlTypeParent); void processSubstGroup(
      @Nonnull final XmlParser xmlParser,
      @Nonnull final XmlType xmlTypeParent,
      @Nonnull final Attributes attributes); }
XmlProcessorElement { public void process( @Nonnull final XmlParser xmlParser, @Nonnull final XmlType xmlTypeParent) throws Exception { if (elementOccurs.equals(OccursEnum.required)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.required(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.oneOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.oneOrMore(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.optional)) { elementProcessor.parentLinkSet(xmlTypeParent, elementName); xmlParser.optional(elementName, elementProcessor); } else if (elementOccurs.equals(OccursEnum.zeroOrMore)) { elementProcessor.parentLinkAdd(xmlTypeParent, elementName); xmlParser.zeroOrMore(elementName, elementProcessor); } } XmlProcessorElement(
      @Nonnull final XmlProcessorType elementProcessorParam,
      @Nonnull final String elementNameParam,
      @Nonnull final OccursEnum elementOccursParam); void process(
      @Nonnull final XmlParser xmlParser,
      @Nonnull final XmlType xmlTypeParent); void processSubstGroup(
      @Nonnull final XmlParser xmlParser,
      @Nonnull final XmlType xmlTypeParent,
      @Nonnull final Attributes attributes);  }