41
|
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 |
* Adapter for document interface
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
package com.nokia.tracecompiler.utils;
|
|
20 |
|
|
21 |
import com.nokia.tracecompiler.source.SourceDocumentInterface;
|
|
22 |
import com.nokia.tracecompiler.source.SourceLocationInterface;
|
|
23 |
import com.nokia.tracecompiler.source.SourceParserException;
|
|
24 |
import com.nokia.tracecompiler.source.SourcePropertyProvider;
|
|
25 |
|
|
26 |
/**
|
|
27 |
* Adapter for document interface
|
|
28 |
*
|
|
29 |
*/
|
|
30 |
public class DocumentAdapter implements SourceDocumentInterface {
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Document owner
|
|
34 |
*/
|
|
35 |
private Object owner;
|
|
36 |
|
|
37 |
/*
|
|
38 |
* (non-Javadoc)
|
|
39 |
*
|
|
40 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#
|
|
41 |
* addLocation(com.nokia.tracecompiler.source.SourceLocationInterface)
|
|
42 |
*/
|
|
43 |
public void addLocation(SourceLocationInterface location) {
|
|
44 |
}
|
|
45 |
|
|
46 |
/*
|
|
47 |
* (non-Javadoc)
|
|
48 |
*
|
|
49 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#get(int, int)
|
|
50 |
*/
|
|
51 |
public String get(int start, int length) throws SourceParserException {
|
|
52 |
return ""; //$NON-NLS-1$
|
|
53 |
}
|
|
54 |
|
|
55 |
/*
|
|
56 |
* (non-Javadoc)
|
|
57 |
*
|
|
58 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#getChar(int)
|
|
59 |
*/
|
|
60 |
public char getChar(int offset) throws SourceParserException {
|
|
61 |
return '\0';
|
|
62 |
}
|
|
63 |
|
|
64 |
/*
|
|
65 |
* (non-Javadoc)
|
|
66 |
*
|
|
67 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#getLength()
|
|
68 |
*/
|
|
69 |
public int getLength() {
|
|
70 |
return 0;
|
|
71 |
}
|
|
72 |
|
|
73 |
/*
|
|
74 |
* (non-Javadoc)
|
|
75 |
*
|
|
76 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#
|
|
77 |
* getLineOfOffset(int)
|
|
78 |
*/
|
|
79 |
public int getLineOfOffset(int offset) throws SourceParserException {
|
|
80 |
return -1;
|
|
81 |
}
|
|
82 |
|
|
83 |
/*
|
|
84 |
* (non-Javadoc)
|
|
85 |
*
|
|
86 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#getOwner()
|
|
87 |
*/
|
|
88 |
public Object getOwner() {
|
|
89 |
return owner;
|
|
90 |
}
|
|
91 |
|
|
92 |
/*
|
|
93 |
* (non-Javadoc)
|
|
94 |
*
|
|
95 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#
|
|
96 |
* removeLocation(com.nokia.tracecompiler.source.SourceLocationInterface)
|
|
97 |
*/
|
|
98 |
public void removeLocation(SourceLocationInterface location) {
|
|
99 |
}
|
|
100 |
|
|
101 |
/*
|
|
102 |
* (non-Javadoc)
|
|
103 |
*
|
|
104 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#replace(int,
|
|
105 |
* int, java.lang.String)
|
|
106 |
*/
|
|
107 |
public void replace(int offset, int length, String newText)
|
|
108 |
throws SourceParserException {
|
|
109 |
}
|
|
110 |
|
|
111 |
/*
|
|
112 |
* (non-Javadoc)
|
|
113 |
*
|
|
114 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#
|
|
115 |
* setOwner(java.lang.Object)
|
|
116 |
*/
|
|
117 |
public void setOwner(Object owner) {
|
|
118 |
this.owner = owner;
|
|
119 |
}
|
|
120 |
|
|
121 |
/*
|
|
122 |
* (non-Javadoc)
|
|
123 |
*
|
|
124 |
* @see com.nokia.tracecompiler.source.SourceDocumentInterface#getPropertyProvider()
|
|
125 |
*/
|
|
126 |
public SourcePropertyProvider getPropertyProvider() {
|
|
127 |
return null;
|
|
128 |
}
|
|
129 |
|
|
130 |
}
|