public IDocument createDocument() { IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(new JSPSourceParser()); return structuredDocument; }
protected IEncodedDocument newEncodedDocument() { IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser()); ((BasicStructuredDocument) structuredDocument).setReParser(new XMLStructuredDocumentReParser()); return structuredDocument; }
protected IEncodedDocument newEncodedDocument() { IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser()); if (structuredDocument instanceof BasicStructuredDocument) { ((BasicStructuredDocument) structuredDocument).setReParser(new XMLStructuredDocumentReParser()); } return structuredDocument; }
protected IEncodedDocument newEncodedDocument() { // DMW: I copied this from CSSModelImple ... // but am not sure its right IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser()); CSSStructuredDocumentReParser reParser = new CSSStructuredDocumentReParser(); reParser.setStructuredDocument(structuredDocument); ((BasicStructuredDocument) structuredDocument).setReParser(reParser); return structuredDocument; }
/** * This method must return a new instance of IStructuredDocument, that has * been initialized with appropriate parser. For many loaders, the * (default) parser used is known for any input. For others, the correct * parser (and its initialization) is normall dependent on the content of * the file. This no-argument method should assume "empty input" and would * therefore return the default parser for the default contentType. * * If the parser is to handle tag libraries, it must have a TaglibSupport * object with a valid URIResolver and this IStructuredDocument attached * to it before the contents are set on the IStructuredDocument. */ public IStructuredDocument newStructuredDocument() { IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser()); ((BasicStructuredDocument) structuredDocument).setReParser(new JSPReParser()); // structuredDocument.setDocumentPartitioner(new // JSPJavaDocumentPartioner()); // even though this is an "empty model" ... we want it to have at // least the // default embeddeded content type handler EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType(null); embeddedType.initializeParser((JSPCapableParser) structuredDocument.getParser()); return structuredDocument; }
/** * This method must return a new instance of IStructuredDocument, that has * been initialized with appropriate parser. For many loaders, the * (default) parser used is known for any input. For others, the correct * parser (and its initialization) is normall dependent on the content of * the file. This no-argument method should assume "empty input" and would * therefore return the default parser for the default contentType. If the * parser is to handle tag libraries, it must have a TaglibSupport object * with a valid URIResolver and this IStructuredDocument attached to it * before the contents are set on the IStructuredDocument. */ protected IEncodedDocument newEncodedDocument() { IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser()); ((BasicStructuredDocument) structuredDocument).setReParser(new JSPReParser()); // structuredDocument.setDocumentPartitioner(new // JSPJavaDocumentPartioner()); // even though this is an "empty model" ... we want it to have at // least // the // default embeddeded content type handler EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType(); embeddedType.initializeParser((JSPCapableParser) structuredDocument.getParser()); return structuredDocument; }
public boolean parse(String filePath) { getLocalParser().removeStructuredDocumentRegionHandler(this); // from outer class List blockMarkers = this.fTranslator.getBlockMarkers(); IStructuredDocument document = StructuredDocumentFactory.getNewStructuredDocumentInstance(getLocalParser()); String contents = getContents(filePath); if (contents == null) return false; // this adds the current markers from the outer class list // to this parser so parsing works correctly for (int i = 0; i < blockMarkers.size(); i++) { addBlockMarker((BlockMarker) blockMarkers.get(i)); } reset(contents); // forceParse(); document.set(contents); IStructuredDocumentRegion cursor = document.getFirstStructuredDocumentRegion(); while (cursor != null) { nodeParsed(cursor); cursor = cursor.getNext(); } getLocalParser().addStructuredDocumentRegionHandler(this); return true; }