|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 * Base class for document factories |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracecompiler.utils; |
|
20 |
|
21 import com.nokia.tracecompiler.source.SourceDocumentFactory; |
|
22 import com.nokia.tracecompiler.source.SourceDocumentInterface; |
|
23 import com.nokia.tracecompiler.source.SourceLocationBase; |
|
24 import com.nokia.tracecompiler.source.SourceLocationInterface; |
|
25 |
|
26 /** |
|
27 * Base class for document factories |
|
28 * |
|
29 */ |
|
30 public class DocumentFactoryBase implements SourceDocumentFactory { |
|
31 |
|
32 /* |
|
33 * (non-Javadoc) |
|
34 * |
|
35 * @see com.nokia.tracecompiler.source.SourceDocumentFactory# |
|
36 * createDocument(java.lang.String) |
|
37 */ |
|
38 public SourceDocumentInterface createDocument(String sourceData) { |
|
39 return new DocumentAdapter(); |
|
40 } |
|
41 |
|
42 /* |
|
43 * (non-Javadoc) |
|
44 * |
|
45 * @see com.nokia.tracecompiler.source.SourceDocumentFactory# |
|
46 * createLocation(com.nokia.tracecompiler.source.SourceLocationBase, |
|
47 * int, int) |
|
48 */ |
|
49 public SourceLocationInterface createLocation(SourceLocationBase base, |
|
50 int offset, int length) { |
|
51 return new SimpleLocation(offset, length); |
|
52 } |
|
53 |
|
54 } |