Package cuchaz.enigma.mapping

Examples of cuchaz.enigma.mapping.BehaviorEntry


  {
    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


  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() );
    }
    else
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;
      if( constructorEntry.isStatic() )
View Full Code Here

 
  @Test
  @SuppressWarnings( "unchecked" )
  public void baseDefault( )
  {
    BehaviorEntry source = new ConstructorEntry( m_baseClass, "()V" );
    Collection<EntryReference<BehaviorEntry,BehaviorEntry>> references = m_index.getBehaviorReferences( source );
    assertThat( references, containsInAnyOrder(
      newBehaviorReferenceByMethod( source, m_callerClass.getName(), "a", "()V" ),
      newBehaviorReferenceByConstructor( source, m_subClass.getName(), "()V" ),
      newBehaviorReferenceByConstructor( source, m_subClass.getName(), "(III)V" )
View Full Code Here

 
  @Test
  @SuppressWarnings( "unchecked" )
  public void baseInt( )
  {
    BehaviorEntry source = new ConstructorEntry( m_baseClass, "(I)V" );
    assertThat( m_index.getBehaviorReferences( source ), containsInAnyOrder(
      newBehaviorReferenceByMethod( source, m_callerClass.getName(), "b", "()V" )
    ) );
  }
View Full Code Here

  @Test
  @SuppressWarnings( "unchecked" )
  public void subDefault( )
  {
    BehaviorEntry source = new ConstructorEntry( m_subClass, "()V" );
    assertThat( m_index.getBehaviorReferences( source ), containsInAnyOrder(
      newBehaviorReferenceByMethod( source, m_callerClass.getName(), "c", "()V" ),
      newBehaviorReferenceByConstructor( source, m_subClass.getName(), "(I)V" )
    ) );
  }
View Full Code Here

  @Test
  @SuppressWarnings( "unchecked" )
  public void subInt( )
  {
    BehaviorEntry source = new ConstructorEntry( m_subClass, "(I)V" );
    assertThat( m_index.getBehaviorReferences( source ), containsInAnyOrder(
      newBehaviorReferenceByMethod( source, m_callerClass.getName(), "d", "()V" ),
      newBehaviorReferenceByConstructor( source, m_subClass.getName(), "(II)V" ),
      newBehaviorReferenceByConstructor( source, m_subsubClass.getName(), "(I)V" )
    ) );
View Full Code Here

  @Test
  @SuppressWarnings( "unchecked" )
  public void subIntInt( )
  {
    BehaviorEntry source = new ConstructorEntry( m_subClass, "(II)V" );
    assertThat( m_index.getBehaviorReferences( source ), containsInAnyOrder(
      newBehaviorReferenceByMethod( source, m_callerClass.getName(), "e", "()V" )
    ) );
  }
View Full Code Here

  }

  @Test
  public void subIntIntInt( )
  {
    BehaviorEntry source = new ConstructorEntry( m_subClass, "(III)V" );
    assertThat( m_index.getBehaviorReferences( source ), is( empty() ) );
  }
View Full Code Here

  @Test
  @SuppressWarnings( "unchecked" )
  public void subsubInt( )
  {
    BehaviorEntry source = new ConstructorEntry( m_subsubClass, "(I)V" );
    assertThat( m_index.getBehaviorReferences( source ), containsInAnyOrder(
      newBehaviorReferenceByMethod( source, m_callerClass.getName(), "f", "()V" )
    ) );
  }
View Full Code Here

TOP

Related Classes of cuchaz.enigma.mapping.BehaviorEntry

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.