1 2 29 package com.puppycrawl.tools.checkstyle.checks.usage.transmogrify; 30 31 32 33 34 38 public class PackageDef extends DefaultScope implements IPackage { 39 40 public PackageDef(String name, Scope parentScope, SymTabAST node) { 41 super(name, parentScope, node); 42 } 43 44 public LabelDef getLabelDefinition(String name) { 45 throw new UnsupportedOperationException (getClass().getName()); 46 } 47 48 public IClass getClass(String name) { 49 return (IClass)classes.get(name); 50 } 51 52 public IPackage getEnclosingPackage() { 53 return this; 54 } 55 56 public IVariable getVariableDefinition(String name) { 57 return null; 58 } 59 60 public void addDefinition(IPackage def) { 61 if (elements.get(def.getName()) == null) { 62 elements.put(def.getName(), def); 63 } 64 } 65 66 } 67 | Popular Tags |