Package cuchaz.enigma.mapping

Examples of cuchaz.enigma.mapping.ClassEntry


  public Void visitInvocationExpression( InvocationExpression node, SourceIndex index )
  {
    MemberReference ref = node.getUserData( Keys.MEMBER_REFERENCE );
   
    // get the behavior entry
    ClassEntry classEntry = new ClassEntry( ref.getDeclaringType().getInternalName() );
    BehaviorEntry behaviorEntry = null;
    if( ref instanceof MethodReference )
    {
      MethodReference methodRef = (MethodReference)ref;
      if( methodRef.isConstructor() )
View Full Code Here


      if( ref.getSignature().indexOf( '(' ) >= 0 )
      {
        throw new Error( "Expected a field here! got " + ref );
      }
     
      ClassEntry classEntry = new ClassEntry( ref.getDeclaringType().getInternalName() );
      FieldEntry fieldEntry = new FieldEntry( classEntry, ref.getName() );
      index.addReference( node.getMemberNameToken(), fieldEntry, m_behaviorEntry );
    }
   
    return recurse( node, index );
View Full Code Here

  public Void visitSimpleType( SimpleType node, SourceIndex index )
  {
    TypeReference ref = node.getUserData( Keys.TYPE_REFERENCE );
    if( node.getIdentifierToken().getStartLocation() != TextLocation.EMPTY )
    {
      ClassEntry classEntry = new ClassEntry( ref.getInternalName() );
      index.addReference( node.getIdentifierToken(), classEntry, m_behaviorEntry );
    }
   
    return recurse( node, index );
  }
View Full Code Here

 
  @Override
  public Void visitParameterDeclaration( ParameterDeclaration node, SourceIndex index )
  {
    ParameterDefinition def = node.getUserData( Keys.PARAMETER_DEFINITION );
    ClassEntry classEntry = new ClassEntry( def.getDeclaringType().getInternalName() );
    MethodDefinition methodDef = (MethodDefinition)def.getMethod();
    BehaviorEntry behaviorEntry;
    if( methodDef.isConstructor() )
    {
      behaviorEntry = new ConstructorEntry( classEntry, methodDef.getSignature() );
View Full Code Here

  public Void visitIdentifierExpression( IdentifierExpression node, SourceIndex index )
  {
    MemberReference ref = node.getUserData( Keys.MEMBER_REFERENCE );
    if( ref != null )
    {
      ClassEntry classEntry = new ClassEntry( ref.getDeclaringType().getInternalName() );
      FieldEntry fieldEntry = new FieldEntry( classEntry, ref.getName() );
      index.addReference( node.getIdentifierToken(), fieldEntry, m_behaviorEntry );
    }
   
    return recurse( node, index );
View Full Code Here

  public Void visitObjectCreationExpression( ObjectCreationExpression node, SourceIndex index )
  {
    MemberReference ref = node.getUserData( Keys.MEMBER_REFERENCE );
    if( ref != null )
    {
      ClassEntry classEntry = new ClassEntry( ref.getDeclaringType().getInternalName() );
      ConstructorEntry constructorEntry = new ConstructorEntry( classEntry, ref.getSignature() );
      if( node.getType() instanceof SimpleType )
      {
        SimpleType simpleTypeNode = (SimpleType)node.getType();
        index.addReference( simpleTypeNode.getIdentifierToken(), constructorEntry, m_behaviorEntry );
View Full Code Here

  @Override
  public Void visitTypeDeclaration( TypeDeclaration node, SourceIndex index )
  {
    // is this this class, or a subtype?
    TypeDefinition def = node.getUserData( Keys.TYPE_DEFINITION );
    ClassEntry classEntry = new ClassEntry( def.getInternalName() );
    if( !classEntry.equals( m_classEntry ) )
    {
      // it's a sub-type, recurse
      index.addDeclaration( node.getNameToken(), classEntry );
      return node.acceptVisitor( new SourceIndexClassVisitor( classEntry ), index );
    }
View Full Code Here

  public Void visitSimpleType( SimpleType node, SourceIndex index )
  {
    TypeReference ref = node.getUserData( Keys.TYPE_REFERENCE );
    if( node.getIdentifierToken().getStartLocation() != TextLocation.EMPTY )
    {
      ClassEntry classEntry = new ClassEntry( ref.getInternalName() );
      index.addReference( node.getIdentifierToken(), classEntry, m_classEntry );
    }
   
    return recurse( node, index );
  }
View Full Code Here

 
  @Override
  public Void visitMethodDeclaration( MethodDeclaration node, SourceIndex index )
  {
    MethodDefinition def = node.getUserData( Keys.METHOD_DEFINITION );
    ClassEntry classEntry = new ClassEntry( def.getDeclaringType().getInternalName() );
    BehaviorEntry behaviorEntry = BehaviorEntryFactory.create( classEntry, def.getName(), def.getSignature() );
    AstNode tokenNode = node.getNameToken();
    if( behaviorEntry instanceof ConstructorEntry )
    {
      ConstructorEntry constructorEntry = (ConstructorEntry)behaviorEntry;
View Full Code Here

 
  @Override
  public Void visitConstructorDeclaration( ConstructorDeclaration node, SourceIndex index )
  {
    MethodDefinition def = node.getUserData( Keys.METHOD_DEFINITION );
    ClassEntry classEntry = new ClassEntry( def.getDeclaringType().getInternalName() );
    ConstructorEntry constructorEntry = new ConstructorEntry( classEntry, def.getSignature() );
    index.addDeclaration( node.getNameToken(), constructorEntry );
    return node.acceptVisitor( new SourceIndexBehaviorVisitor( constructorEntry ), index );
  }
View Full Code Here

TOP

Related Classes of cuchaz.enigma.mapping.ClassEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.