1 package com.stateofflow.eclipse.metrics.type;
2
3 import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
4 import org.eclipse.jdt.core.dom.ITypeBinding;
5
6 public final class EnumConstantDeclarationAdapter extends NonNullType {
7 public EnumConstantDeclarationAdapter(final EnumConstantDeclaration node) {
8 super(node);
9 }
10
11 protected String getNamePart() {
12 return getTypedNode().getName().getIdentifier();
13 }
14
15 protected String getNameWithAnonymousChild(final AnonymousClassDeclarationAdapter child) {
16 return getName();
17 }
18
19 public int getStartPosition() {
20 return getTypedNode().getName().getStartPosition();
21 }
22
23 private EnumConstantDeclaration getTypedNode() {
24 return (EnumConstantDeclaration) getNode();
25 }
26
27 public ITypeBinding resolveBinding() {
28 return getTypedNode().resolveVariable().getType();
29 }
30 }
31