Пример #1
0
  /**
   * createDocument
   *
   * @param partitionType
   * @param source
   * @return
   */
  static IDocument createDocument(String source) {
    CompositePartitionScanner partitionScanner =
        new CompositePartitionScanner(
            CSSSourceConfiguration.getDefault().createSubPartitionScanner(),
            new NullSubPartitionScanner(),
            new NullPartitionerSwitchStrategy());
    IDocumentPartitioner partitioner =
        new ExtendedFastPartitioner(
            partitionScanner, CSSSourceConfiguration.getDefault().getContentTypes());
    partitionScanner.setPartitioner((IExtendedPartitioner) partitioner);

    final IDocument document = new Document(source);
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);

    return document;
  }
 /** HTMLSubPartitionScanner */
 public HTMLSubPartitionScanner() {
   super( //
       new ISubPartitionScanner[] { //
         new SubPartitionScanner( //
             HTMLSourceConfiguration.getDefault().getPartitioningRules(), //
             HTMLSourceConfiguration.CONTENT_TYPES, //
             new Token(HTMLSourceConfiguration.DEFAULT) //
             ), //
         JSSourceConfiguration.getDefault().createSubPartitionScanner(), //
         CSSSourceConfiguration.getDefault().createSubPartitionScanner(), //
         SVGSourceConfiguration.getDefault().createSubPartitionScanner() //
       }, //
       new IPartitionScannerSwitchStrategy[] { //
         new PartitionScannerSwitchStrategy(JS_SWITCH_SEQUENCES), //
         new PartitionScannerSwitchStrategy(CSS_SWITCH_SEQUENCES), //
         new PartitionScannerSwitchStrategy(SVG_SWITCH_SEQUENCES) //
       } //
       );
 }
 public OldCSSSourcePartitionScanner() {
   super(CSSSourceConfiguration.getDefault());
 }