summaryrefslogtreecommitdiff
path: root/xml/dom-tests/tests/com/intellij/util/xml/MockDomFileElement.java
blob: b2bbb5f3057735d44cb26ede9a71476c4f204f7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/*
 * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
 */
package com.intellij.util.xml;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.util.UserDataHolderBase;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.xml.XmlElement;
import com.intellij.psi.xml.XmlFile;
import com.intellij.psi.xml.XmlTag;
import com.intellij.util.xml.reflect.DomGenericInfo;
import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

/**
 * @author peter
 */
public class MockDomFileElement extends UserDataHolderBase implements DomFileElement<DomElement>{
  private long myModCount = 0;
  private DomFileDescription myFileDescription;

  public void setFileDescription(final DomFileDescription fileDescription) {
    myFileDescription = fileDescription;
  }

  @Override
  @NotNull
  public XmlFile getFile() {
    throw new UnsupportedOperationException("Method getFile is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  public XmlFile getOriginalFile() {
    throw new UnsupportedOperationException("Method getOriginalFile is not yet implemented in " + getClass().getName());
  }

  @Override
  public XmlTag getRootTag() {
    throw new UnsupportedOperationException("Method getRootTag is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  public DomElement getRootElement() {
    throw new UnsupportedOperationException("Method getRootElement is not yet implemented in " + getClass().getName());
  }

  @Override
  public Class getRootElementClass() {
    throw new UnsupportedOperationException("Method getRootElementType is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  public DomFileDescription getFileDescription() {
    return myFileDescription;
  }

  @Override
  @Nullable
  public XmlTag getXmlTag() {
    throw new UnsupportedOperationException("Method getXmlTag is not yet implemented in " + getClass().getName());
  }

  @NotNull
  public <T extends DomElement> DomFileElement<T> getRoot() {
    return (DomFileElement<T>)this;
  }

  @Override
  @Nullable
  public DomElement getParent() {
    throw new UnsupportedOperationException("Method getParent is not yet implemented in " + getClass().getName());
  }

  @Override
  public XmlTag ensureTagExists() {
    throw new UnsupportedOperationException("Method ensureTagExists is not yet implemented in " + getClass().getName());
  }

  @Override
  @Nullable
  public XmlElement getXmlElement() {
    throw new UnsupportedOperationException("Method getXmlElement is not yet implemented in " + getClass().getName());
  }

  @Override
  public XmlElement ensureXmlElementExists() {
    throw new UnsupportedOperationException("Method ensureXmlElementExists is not yet implemented in " + getClass().getName());
  }

  @Override
  public void undefine() {
    throw new UnsupportedOperationException("Method undefine is not yet implemented in " + getClass().getName());
  }

  @Override
  public boolean isValid() {
    throw new UnsupportedOperationException("Method isValid is not yet implemented in " + getClass().getName());
  }

  @Override
  public boolean exists() {
    throw new UnsupportedOperationException("Method exists is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  public DomGenericInfo getGenericInfo() {
    throw new UnsupportedOperationException("Method getGenericInfo is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  @NonNls
  public String getXmlElementName() {
    throw new UnsupportedOperationException("Method getXmlElementName is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  @NonNls
  public String getXmlElementNamespace() {
    throw new UnsupportedOperationException("Method getXmlElementNamespace is not yet implemented in " + getClass().getName());
  }

  @Override
  @Nullable
  @NonNls
  public String getXmlElementNamespaceKey() {
    throw new UnsupportedOperationException("Method getXmlElementNamespaceKey is not yet implemented in " + getClass().getName());
  }

  @Override
  public void accept(final DomElementVisitor visitor) {
    throw new UnsupportedOperationException("Method accept is not yet implemented in " + getClass().getName());
  }

  @Override
  public void acceptChildren(DomElementVisitor visitor) {
  }

  @Override
  @NotNull
  public DomManager getManager() {
    throw new UnsupportedOperationException("Method getManager is not yet implemented in " + getClass().getName());
  }

  @Override
  public Type getDomElementType() {
    throw new UnsupportedOperationException("Method getDomElementType is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  public AbstractDomChildrenDescription getChildDescription() {
    throw new UnsupportedOperationException("Method getChildDescription is not yet implemented in " + getClass().getName());
  }

  @Override
  public DomNameStrategy getNameStrategy() {
    throw new UnsupportedOperationException("Method getNameStrategy is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  public ElementPresentation getPresentation() {
    throw new UnsupportedOperationException("Method getPresentation is not yet implemented in " + getClass().getName());
  }

  @Override
  public GlobalSearchScope getResolveScope() {
    throw new UnsupportedOperationException("Method getResolveScope is not yet implemented in " + getClass().getName());
  }

  @Override
  @Nullable
  public <T extends DomElement> T getParentOfType(Class<T> requiredClass, boolean strict) {
    throw new UnsupportedOperationException("Method getParentOfType is not yet implemented in " + getClass().getName());
  }

  @Override
  @Nullable
  public Module getModule() {
    throw new UnsupportedOperationException("Method getModule is not yet implemented in " + getClass().getName());
  }

  @Override
  public void copyFrom(DomElement other) {
    throw new UnsupportedOperationException("Method copyFrom is not yet implemented in " + getClass().getName());
  }

  @Override
  public <T extends DomElement> T createMockCopy(final boolean physical) {
    throw new UnsupportedOperationException("Method createMockCopy is not yet implemented in " + getClass().getName());
  }

  @Override
  public <T extends DomElement> T createStableCopy() {
    throw new UnsupportedOperationException("Method createStableCopy is not yet implemented in " + getClass().getName());
  }

  @Override
  @Nullable
  public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
    throw new UnsupportedOperationException("Method getAnnotation is not yet implemented in " + getClass().getName());
  }

  @Override
  public long getModificationCount() {
    return myModCount;
  }

  public void incModificationCount() {
    myModCount++;
  }
}