Examples of FieldEntry


Examples of com.caucho.quercus.program.ClassDef.FieldEntry

  /**
   * Adds a value.
   */
  public Expr get(Value name)
  {
    FieldEntry entry = _fieldMap.get(name.toStringValue());

    if (entry != null)
      return entry.getValue();
    else
      return null;
  }
View Full Code Here

Examples of com.caucho.quercus.program.ClassDef.FieldEntry

  public void initInstance(Env env, Value value)
  {
    ObjectValue object = (ObjectValue) value;
   
    for (Map.Entry<StringValue,FieldEntry> entry : _fieldMap.entrySet()) {
      FieldEntry fieldEntry = entry.getValue();

      object.initField(entry.getKey(),
                       fieldEntry.getValue().eval(env).copy(),
                       fieldEntry.getVisibility());
    }

    if (_destructor != null && value instanceof ObjectExtValue)
      env.addObjectCleanup((ObjectExtValue) object);
  }
View Full Code Here

Examples of com.caucho.quercus.program.ClassDef.FieldEntry

   * Returns the comment for the specified field.
   */
  @Override
  public String getFieldComment(StringValue name)
  {
    FieldEntry field = _fieldMap.get(name);
   
    if (field != null)
      return field.getComment();
    else
      return null;
  }
View Full Code Here

Examples of cuchaz.enigma.mapping.FieldEntry

      {
        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

Examples of cuchaz.enigma.mapping.FieldEntry

  {
    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

Examples of cuchaz.enigma.mapping.FieldEntry

  @Override
  public Void visitFieldDeclaration( FieldDeclaration node, SourceIndex index )
  {
    FieldDefinition def = node.getUserData( Keys.FIELD_DEFINITION );
    ClassEntry classEntry = new ClassEntry( def.getDeclaringType().getInternalName() );
    FieldEntry fieldEntry = new FieldEntry( classEntry, def.getName() );
    assert( node.getVariables().size() == 1 );
    VariableInitializer variable = node.getVariables().firstOrNullObject();
    index.addDeclaration( variable.getNameToken(), fieldEntry );
   
    return recurse( node, index );
View Full Code Here

Examples of cuchaz.enigma.mapping.FieldEntry

  public Void visitEnumValueDeclaration( EnumValueDeclaration node, SourceIndex index )
  {
    // treat enum declarations as field declarations
    FieldDefinition def = node.getUserData( Keys.FIELD_DEFINITION );
    ClassEntry classEntry = new ClassEntry( def.getDeclaringType().getInternalName() );
    FieldEntry fieldEntry = new FieldEntry( classEntry, def.getName() );
    index.addDeclaration( node.getNameToken(), fieldEntry );
   
    return recurse( node, index );
  }
View Full Code Here

Examples of cuchaz.enigma.mapping.FieldEntry

      ClassEntry obfClassEntry = new ClassEntry( classMapping.getObfName() );
     
      // fields
      for( FieldMapping fieldMapping : Lists.newArrayList( classMapping.fields() ) )
      {
        FieldEntry fieldEntry = new FieldEntry( obfClassEntry, fieldMapping.getObfName() );
        ClassEntry resolvedObfClassEntry = m_jarIndex.resolveEntryClass( fieldEntry );
        if( resolvedObfClassEntry != null && !resolvedObfClassEntry.equals( fieldEntry.getClassEntry() ) )
        {
          boolean wasMoved = renamer.moveFieldToObfClass( classMapping, fieldMapping, resolvedObfClassEntry );
          if( wasMoved )
          {
            System.out.println( String.format( "Moved field %s to class %s", fieldEntry, resolvedObfClassEntry ) );
View Full Code Here

Examples of cuchaz.enigma.mapping.FieldEntry

    }
   
    // check the fields
    for( FieldMapping fieldMapping : Lists.newArrayList( classMapping.fields() ) )
    {
      FieldEntry fieldEntry = new FieldEntry( classEntry, fieldMapping.getObfName() );
      if( !m_jarIndex.containsObfField( fieldEntry ) )
      {
        System.err.println( "WARNING: unable to find field " + fieldEntry + ". dropping mapping." );
        classMapping.removeFieldMapping( fieldMapping );
      }
View Full Code Here

Examples of cuchaz.enigma.mapping.FieldEntry

 
  @Test
  @SuppressWarnings( "unchecked" )
  public void fieldReferences( )
  {
    FieldEntry source = newField( "none/a", "a" );
    Collection<EntryReference<FieldEntry,BehaviorEntry>> references = m_index.getFieldReferences( source );
    assertThat( references, containsInAnyOrder(
      newFieldReferenceByConstructor( source, "none/a", "(Ljava/lang/String;)V" ),
      newFieldReferenceByMethod( source, "none/a", "a", "()Ljava/lang/String;" )
    ) );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.