Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2002-2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM - Initial API and implementation
 
 package org.eclipse.emf.java.impl;
 
 
 
 
An implementation of the model object 'JField'.

The following features are implemented:

  • Final
  • Transient
  • Volatile
  • Java Field
  • Initializer
  • Type

Generated:
 
 public class JFieldImpl extends JMemberImpl implements JField
 {
  
The default value of the 'Final' attribute.

See also:
isFinal()
Generated:
Ordered:
 
   protected static final boolean FINAL_EDEFAULT = false;

  
The cached value of the 'Final' attribute.

See also:
isFinal()
Generated:
Ordered:
 
   protected boolean final_ = ;

  
The default value of the 'Transient' attribute.

See also:
isTransient()
Generated:
Ordered:
 
   protected static final boolean TRANSIENT_EDEFAULT = false;

  
The cached value of the 'Transient' attribute.

See also:
isTransient()
Generated:
Ordered:
 
   protected boolean transient_ = ;

  
The default value of the 'Volatile' attribute.

See also:
isVolatile()
Generated:
Ordered:
 
   protected static final boolean VOLATILE_EDEFAULT = false;

  
The cached value of the 'Volatile' attribute.

See also:
isVolatile()
Generated:
Ordered:
  protected boolean volatile_ = ;

  
The default value of the 'Java Field' attribute.

See also:
getJavaField()
Generated:
Ordered:
  protected static final Field JAVA_FIELD_EDEFAULT = null;

  
The cached value of the 'Java Field' attribute.

See also:
getJavaField()
Generated:
Ordered:
  protected Field javaField = ;

  
The default value of the 'Initializer' attribute.

See also:
getInitializer()
Generated:
Ordered:
  protected static final String INITIALIZER_EDEFAULT = null;

  
The cached value of the 'Initializer' attribute.

See also:
getInitializer()
Generated:
Ordered:
  protected String initializer = ;

  
The cached value of the 'Type' reference.

See also:
getType()
Generated:
Ordered:
  protected JClass type;

  

Generated:
  protected JFieldImpl()
  {
    super();
  }

  

Generated:
  protected EClass eStaticClass()
  {
    return ..;
  }

  

Generated:
  public boolean isFinal()
  {
    return ;
  }

  

Generated:
  public void setFinal(boolean newFinal)
  {
    boolean oldFinal = ;
     = newFinal;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this..oldFinal));
  }

  

Generated:
  public boolean isTransient()
  {
    return ;
  }

  

Generated:
  public void setTransient(boolean newTransient)
  {
    boolean oldTransient = ;
     = newTransient;
    if (eNotificationRequired())
  }

  

Generated:
  public boolean isVolatile()
  {
    return ;
  }

  

Generated:
  public void setVolatile(boolean newVolatile)
  {
    boolean oldVolatile = ;
     = newVolatile;
    if (eNotificationRequired())
  }

  

Generated:
  public Field getJavaField()
  {
    return ;
  }

  

Generated:
  public void setJavaField(Field newJavaField)
  {
    Field oldJavaField = ;
     = newJavaField;
    if (eNotificationRequired())
  }

  

Generated:
  public String getInitializer()
  {
    return ;
  }

  

Generated:
  public void setInitializer(String newInitializer)
  {
    String oldInitializer = ;
     = newInitializer;
    if (eNotificationRequired())
  }

  

Generated:
  public JClass getType()
  {
    if ( != null && .eIsProxy())
    {
      InternalEObject oldType = (InternalEObject);
       = (JClass)eResolveProxy(oldType);
      if ( != oldType)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this..oldType));
      }
    }
    return ;
  }

  

Generated:
  public JClass basicGetType()
  {
    return ;
  }

  

Generated:
  public void setType(JClass newType)
  {
    JClass oldType = ;
     = newType;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this..oldType));
  }

  

Generated:
  public Object eGet(int featureIDboolean resolveboolean coreType)
  {
    switch (featureID)
    {
      case .:
        return isFinal();
        return isTransient();
      case .:
        return isVolatile();
        return getJavaField();
        return getInitializer();
      case .:
        if (resolvereturn getType();
        return basicGetType();
    }
    return super.eGet(featureIDresolvecoreType);
  }

  

Generated:
  public void eSet(int featureIDObject newValue)
  {
    switch (featureID)
    {
      case .:
        setFinal((Boolean)newValue);
        return;
        setTransient((Boolean)newValue);
        return;
      case .:
        setVolatile((Boolean)newValue);
        return;
        setJavaField((Field)newValue);
        return;
        setInitializer((String)newValue);
        return;
      case .:
        setType((JClass)newValue);
        return;
    }
    super.eSet(featureIDnewValue);
  }

  

Generated:
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case .:
        setFinal();
        return;
        return;
      case .:
        return;
        return;
        return;
      case .:
        setType((JClass)null);
        return;
    }
    super.eUnset(featureID);
  }

  

Generated:
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case .:
        return  != ;
        return  != ;
      case .:
        return  != ;
        return  == null ?  != null : !.equals();
        return  == null ?  != null : !.equals();
      case .:
        return  != null;
    }
    return super.eIsSet(featureID);
  }

  

Generated:
  public String toString()
  {
    if (eIsProxy()) return super.toString();
    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (final: ");
    result.append();
    result.append(", transient: ");
    result.append();
    result.append(", volatile: ");
    result.append();
    result.append(", javaField: ");
    result.append();
    result.append(", initializer: ");
    result.append();
    result.append(')');
    return result.toString();
  }
  protected void changeAttribute(Notification notification)
  {
    switch (notification.getFeatureID(JField.class))
    {
      case .:
      {
        JHelper.handleJNode(this);
        break;
      }
      {
        Field theJavaField = getJavaField();
        if (theJavaField != null)
        {
          setName(theJavaField.getName());
          setType(JavaUtil.createJClassProxy(theJavaField.getType()));
          int modifiers = theJavaField.getModifiers();
          setFinal(Modifier.isFinal(modifiers));
          setStatic(Modifier.isStatic(modifiers));
          setVisibility(JavaUtil.getModifierVisibility(modifiers));
          setTransient(Modifier.isTransient(modifiers));
          setVolatile(Modifier.isVolatile(modifiers));
        }
        break;
      }
    }
  }
  protected static class JHelper
  {
    protected static void handleJNode(JField field)
    {
      org.eclipse.emf.codegen.merge.java.facade.JField jField = (org.eclipse.emf.codegen.merge.java.facade.JField)field.getJNode();
      if (jField != null)
      {
        field.setName(jField.getName());
        field.setComment(jField.getComment());
        field.setInitializer(jField.getInitializer());
        int flags = jField.getFlags();
        field.setFinal((flags & .) != 0);
        field.setStatic((flags & .) != 0);
        field.setVisibility(JavaUtil.getFlagVisibility(flags));
        field.setTransient((flags & .) != 0);
        field.setVolatile((flags & .) != 0);
      }
    }
  }
  protected void resolveIdentifiers()
  {
    if (getJNode() != null)
    {
      org.eclipse.emf.codegen.merge.java.facade.JField jField  = (org.eclipse.emf.codegen.merge.java.facade.JField)getJNode();
      setType(getContainingType().resolveJClass(JavaUtil.separateTypeArgument(jField.getType())[0]));
    }
  }
//JFieldImpl
New to GrepCode? Check out our FAQ X