/** * Create an instance of {@link SequenceType } * */ public SequenceType createSequenceType() { return new SequenceType(); }
private void processSequence() { // 1. check that the sequence type is known if (currentSequenceType == null) { throw new ConversionException(String.format("Sequence '%s': Unknown sequence type", currentSequence.getId())); } // 2. init the sequence contextProvider.getSequenceContext().initSequence(currentSequenceType, currentSequenceUuid); // 3. process all resources within the sequence and segment and fill the Resource context currentSequence.getResourceList().getResource().forEach(this::processResource); }
@Override protected void buildFromCpl() { // 1. get a composition edit rate (it's used if no specific edit rate is specified for a segment). this.compositionEditRate = ConversionHelper.parseEditRate(cpl2013.getEditRate()); // 2. go through all segments and all sequences and build segment, sequence and resource contexts. for (SegmentType segment : cpl2013.getSegmentList().getSegment()) { this.currentSegmentUuid = SegmentUUID.create(segment.getId()); contextProvider.getSegmentContext().initSegment(currentSegmentUuid); for (Object anySeqJaxb : segment.getSequenceList().getAny()) { if (!(anySeqJaxb instanceof JAXBElement)) { throw new ConversionException(String.format("Could not understand a sequence '%s'", anySeqJaxb.toString())); } JAXBElement jaxbElement = (JAXBElement) (anySeqJaxb); Object anySeq = jaxbElement.getValue(); SequenceTypeCpl currentSequenceTypeCpl = SequenceTypeCpl.fromName(jaxbElement.getName().getLocalPart()); if ((currentSequenceTypeCpl != null) && (anySeq instanceof SequenceType)) { this.currentSequence = (SequenceType) anySeq; this.currentSequenceType = currentSequenceTypeCpl.toSequenceType(); this.currentSequenceUuid = SequenceUUID.create(currentSequence.getTrackId()); processSequence(); } } } }
/** * Create an instance of {@link SequenceType } * */ public SequenceType createSequenceType() { return new SequenceType(); }