Package cuchaz.enigma.mapping

Examples of cuchaz.enigma.mapping.Translator


    }
  }

  public Translator getTranslator( TranslationDirection direction )
  {
    Translator translator = m_translatorCache.get( direction );
    if( translator == null )
    {
      translator = m_mappings.getTranslator( direction );
      m_translatorCache.put( direction, translator );
    }
View Full Code Here


 
  // NOTE: these methods are a bit messy... oh well

  public boolean hasDeobfuscatedName( Entry obfEntry )
  {
    Translator translator = getTranslator( TranslationDirection.Deobfuscating );
    if( obfEntry instanceof ClassEntry )
    {
      return translator.translate( (ClassEntry)obfEntry ) != null;
    }
    else if( obfEntry instanceof FieldEntry )
    {
      return translator.translate( (FieldEntry)obfEntry ) != null;
    }
    else if( obfEntry instanceof MethodEntry )
    {
      return translator.translate( (MethodEntry)obfEntry ) != null;
    }
    else if( obfEntry instanceof ConstructorEntry )
    {
      // constructors have no names
      return false;
    }
    else if( obfEntry instanceof ArgumentEntry )
    {
      return translator.translate( (ArgumentEntry)obfEntry ) != null;
    }
    else
    {
      throw new Error( "Unknown entry type: " + obfEntry.getClass().getName() );
    }
View Full Code Here

  }
 
  @Test
  public void classInheritance( )
  {
    ClassInheritanceTreeNode node = m_index.getClassInheritance( new Translator(), newClass( "none/a" ) );
    assertThat( node, is( not( nullValue() ) ) );
    assertThat( node.getObfClassName(), is( "none/a" ) );
    assertThat( node.getChildCount(), is( 0 ) );
  }
View Full Code Here

  @Test
  public void methodInheritance( )
  {
    MethodEntry source = newMethod( "none/a", "a", "()Ljava/lang/String;" );
    MethodInheritanceTreeNode node = m_index.getMethodInheritance( new Translator(), source );
    assertThat( node, is( not( nullValue() ) ) );
    assertThat( node.getMethodEntry(), is( source ) );
    assertThat( node.getChildCount(), is( 0 ) );
  }
View Full Code Here

  }
 
  @Test
  public void classImplementations( )
  {
    ClassImplementationsTreeNode node = m_index.getClassImplementations( new Translator(), newClass( "none/a" ) );
    assertThat( node, is( nullValue() ) );
  }
View Full Code Here

 
  @Test
  public void methodImplementations( )
  {
    MethodEntry source = newMethod( "none/a", "a", "()Ljava/lang/String;" );
    MethodImplementationsTreeNode node = m_index.getMethodImplementations( new Translator(), source );
    assertThat( node, is( nullValue() ) );
  }
View Full Code Here

  private Map<String,byte[]> m_cache;
  private ClasspathTypeLoader m_defaultTypeLoader;
 
  public TranslatingTypeLoader( JarFile jar, JarIndex jarIndex )
  {
    this( jar, jarIndex, new Translator(), new Translator() );
  }
View Full Code Here

TOP

Related Classes of cuchaz.enigma.mapping.Translator

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.