org.eclipse.jem.proxy_2.0.400.v201101101900

eclipse.jem.internal.proxy.core.IBeanTypeProxy;
import org.eclipse.jem.internal.proxy.core.IConstructorProxy;
import org.eclipse.jem.internal.proxy.core.IFieldProxy;
import org.eclipse.jem.internal.proxy.core.IMethodProxy;
import org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory;
import org.eclipse.jem.internal.proxy.core.ThrowableProxy;

public final class IDEArrayBeanTypeProxy
  extends IDEBeanTypeProxy
  implements IArrayBeanTypeProxy
{
  IBeanTypeProxy fFinalComponentType;
  IBeanTypeProxy fComponentType;
  String fTypeName;
  
  IDEArrayBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, String aTypeName, Class aClass)
  {
    super(aRegistry, aClass);
    fTypeName = aTypeName;
  }
  
  public boolean isArray()
  {
    return true;
  }
  
  public String getTypeName()
  {
    return fTypeName;
  }
  
  public IBeanTypeProxy getFinalComponentType()
  {
    if (fFinalComponentType == null)
    {
      int typeStart = getTypeName().lastIndexOf('[') + 1;
      if (getTypeName().charAt(typeStart) == 'L')
      {
        fFinalComponentType = fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(
          getTypeName().substring(typeStart + 1, getTypeName().length() - 1));
      }
      else
      {
        Class aType = (Class)IDEStandardBeanTypeProxyFactory.MAP_SHORTSIG_TO_TYPE.get(getTypeName().substring(typeStart, typeStart + 1));
        fFinalComponentType = (aType != null ? fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(aType.getName()) : null);
      }
    }
    return fFinalComponentType;
  }
  
  public IBeanTypeProxy getComponentType()
  {
    if (fComponentType == null) {
      if (getTypeName().charAt(1) != '[') {
        fComponentType = getFinalComponentType();
      } else {
        fComponentType = fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(getTypeName().substring(1));
      }
    }
    return fComponentType;
  }
  
  public int getDimensions()
  {
    return getTypeName().lastIndexOf('[') + 1;
  }
  
  public IConstructorProxy getNullConstructorProxy()
  {
    throw new UnsupportedOperationException();
  }
  
  public IConstructorProxy getConstructorProxy(String[] argumentClassNames)
  {
    throw new UnsupportedOperationException();
  }
  
  public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] argumentTypes)
  {
    throw new UnsupportedOperationException();
  }
  
  public IConstructorProxy[] getConstructors()
  {
    throw new UnsupportedOperationException();
  }
  
  public IConstructorProxy getDeclaredConstructorProxy(String[] argumentClassNames)
  {
    throw new UnsupportedOperationException();
  }
  
  public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] argumentTypes)
  {
    throw new UnsupportedOperationException();
  }
  
  public IConstructorProxy[] getDeclaredConstructors()
  {
    throw new UnsupportedOperationException();
  }
  
  public IFieldProxy[] getFields()
  {
    throw new UnsupportedOperationException();
  }
  
  public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes)
  {
    throw new UnsupportedOperationException();
  }
  
  public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes)
  {
    throw new UnsupportedOperationException();
  }
  
  public IFieldProxy[] getDeclaredFields()
  {
    throw new UnsupportedOperationException();
  }
  
  public IFieldProxy getFieldProxy(String fieldName)
  {
    throw new UnsupportedOperationException();
  }
  
  public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes)
  {
    throw new UnsupportedOperationException();
  }
  
  public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames)
  {
    throw new UnsupportedOperationException();
  }
  
  public IMethodProxy getMethodProxy(String methodName, String argumentQualifiedTypeName)
  {
    throw new UnsupportedOperationException();
  }
  
  public IMethodProxy getMethodProxy(String methodName)
  {
    throw new UnsupportedOperationException();
  }
  
  public IMethodProxy[] getMethods()
  {
    throw new UnsupportedOperationException();
  }
  
  public IMethodProxy[] getDeclaredMethods()
  {
    throw new UnsupportedOperationException();
  }
  
  public IMethodProxy getDeclaredMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes)
  {
    throw new UnsupportedOperationException();
  }
  
  public IMethodProxy getDeclaredMethodProxy(String methodName, String[] argumentClassNames)
  {
    throw new UnsupportedOperationException();
  }
  
  IDEArrayBeanProxy createBeanProxyWith(int[] dimensions)
    throws ThrowableProxy
  {
    if ((dimensions == null) || (dimensions.length == 0)) {
      return createBeanProxyWith(new int[1]);
    }
    IBeanTypeProxy compType = null;
    int numDims = getDimensions();
    if (numDims <= dimensions.length)
    {
      compType = getFinalComponentType();
    }
    else
    {
      String compClass = getTypeName().substring(dimensions.length);
      compType = fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(compClass);
    }
    if (dimensions.length == 1)
    {
      Object array = Array.newInstance(fClass, dimensions[0]);
      return new IDEArrayBeanProxy(fProxyFactoryRegistry, array, null);
    }
    Object array = Array.newInstance(fClass, dimensions);
    return new IDEArrayBeanProxy(fProxyFactoryRegistry, array, null);
  }
  
  protected IIDEBeanProxy newBeanProxy(Object anObject)
  {
    return new IDEArrayBeanProxy(fProxyFactoryRegistry, anObject, this);
  }
  
  public String getFormalTypeName()
  {
    String name = getTypeName();
    int dims = name.lastIndexOf('[') + 1;
    String type = getFinalComponentType().getTypeName();
    StringBuffer formalType = new StringBuffer(type.length() + "[]".length() * dims);
    formalType.append(type);
    for (int i = 0; i < dims; i++) {
      formalType.append("[]");
    }
    return formalType.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEArrayBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.IBeanProxy;
import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry;

public abstract class IDEBeanProxy
  implements IBeanProxy, IIDEBeanProxy
{
  protected Object fBean;
  protected final IDEProxyFactoryRegistry fProxyFactoryRegistry;
  
  protected IDEBeanProxy(IDEProxyFactoryRegistry aProxyFactoryRegistry)
  {
    fProxyFactoryRegistry = aProxyFactoryRegistry;
  }
  
  protected IDEBeanProxy(IDEProxyFactoryRegistry aProxyFactoryRegistry, Object anObject)
  {
    fProxyFactoryRegistry = aProxyFactoryRegistry;
    fBean = anObject;
  }
  
  public boolean isValid()
  {
    return true;
  }
  
  public ProxyFactoryRegistry getProxyFactoryRegistry()
  {
    return fProxyFactoryRegistry;
  }
  
  public final Object getBean()
  {
    return fBean;
  }
  
  public String toBeanString()
  {
    return fBean != null ? fBean.toString() : "null";
  }
  
  public String toString()
  {
    if (fBean == null) {
      return super.toString();
    }
    return super.toString() + "(" + fBean.toString() + ")";
  }
  
  public boolean equals(Object obj)
  {
    if (super.equals(obj)) {
      return true;
    }
    if ((obj instanceof IIDEBeanProxy)) {
      return fBean.equals(((IIDEBeanProxy)obj).getBean());
    }
    return false;
  }
  
  public int hashCode()
  {
    return '?' + (getBean() != null ? getBean().hashCode() : 0);
  }
  
  public boolean sameAs(IBeanProxy aBeanProxy)
  {
    if (this == aBeanProxy) {
      return true;
    }
    if ((aBeanProxy instanceof IIDEBeanProxy)) {
      return getBean() == ((IIDEBeanProxy)aBeanProxy).getBean();
    }
    return false;
  }
  
  public final boolean isBeanProxy()
  {
    return true;
  }
  
  public final boolean isExpressionProxy()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEBeanProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.eclipse.core.runtime.Status;
import org.eclipse.jem.internal.proxy.common.AmbiguousMethodException;
import org.eclipse.jem.internal.proxy.core.Expression;
import org.eclipse.jem.internal.proxy.core.IBeanProxy;
import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
import org.eclipse.jem.internal.proxy.core.IConstructorProxy;
import org.eclipse.jem.internal.proxy.core.IExpression;
import org.eclipse.jem.internal.proxy.core.IFieldProxy;
import org.eclipse.jem.internal.proxy.core.IInvokable;
import org.eclipse.jem.internal.proxy.core.IMethodProxy;
import org.eclipse.jem.internal.proxy.core.IProxyBeanType;
import org.eclipse.jem.internal.proxy.core.IProxyField;
import org.eclipse.jem.internal.proxy.core.IProxyMethod;
import org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory;
import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry;
import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
import org.eclipse.jem.util.logger.proxy.Logger;
import org.osgi.framework.Bundle;

public class IDEBeanTypeProxy
  extends IDEBeanProxy
  implements IBeanTypeProxy
{
  protected IDEProxyFactoryRegistry fProxyFactoryRegistry;
  Class fClass;
  
  protected IDEBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass);
    fProxyFactoryRegistry = aRegistry;
    fClass = aClass;
  }
  
  public IBeanTypeProxy getTypeProxy()
  {
    return fProxyFactoryRegistry.getBeanTypeProxyFactory()).classClass;
  }
  
  public Class getTypeClass()
  {
    return fClass;
  }
  
  public String toBeanString()
  {
    return fClass.toString();
  }
  
  public ProxyFactoryRegistry getProxyFactoryRegistry()
  {
    return fProxyFactoryRegistry;
  }
  
  public String getTypeName()
  {
    return fClass.getName();
  }
  
  public boolean isKindOf(IBeanTypeProxy aBeanTypeProxy)
  {
    return fClass.isAssignableFrom(fClass);
  }
  
  public boolean isInterface()
  {
    return fClass.isInterface();
  }
  
  public boolean isPrimitive()
  {
    return fClass.isPrimitive();
  }
  
  public boolean isArray()
  {
    return fClass.isArray();
  }
  
  public IMethodProxy[] getMethods()
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getMethods(fClass);
  }
  
  public IMethodProxy[] getDeclaredMethods()
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredMethods(fClass);
  }
  
  public IMethodProxy getMethodProxy(String methodName)
  {
    try
    {
      Method aMethod = fClass.getMethod(methodName, new Class[0]);
      return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getMethodProxy(aMethod);
    }
    catch (Exception exc)
    {
      ProxyPlugin.getPlugin().getLogger().log(new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc));
    }
    return null;
  }
  
  public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames)
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getMethodProxy(this, methodName, argumentClassNames);
  }
  
  public IMethodProxy getMethodProxy(String methodName, String firstArgClass)
  {
    return getMethodProxy(methodName, new String[] { firstArgClass });
  }
  
  public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] args)
  {
    Class[] argClasses = new Class[args.length];
    for (int i = 0; i < args.length; i++) {
      argClasses[i] = fClass;
    }
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getMethodProxy(fClass, methodName, argClasses);
  }
  
  public IMethodProxy getDeclaredMethodProxy(String methodName, String[] argumentClassNames)
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredMethodProxy(fClass, methodName, argumentClassNames);
  }
  
  public IMethodProxy getDeclaredMethodProxy(String methodName, IBeanTypeProxy[] args)
  {
    Class[] argClasses = (Class[])null;
    if (args != null)
    {
      argClasses = new Class[args.length];
      for (int i = 0; i < args.length; i++) {
        argClasses[i] = fClass;
      }
    }
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredMethodProxy(fClass, methodName, argClasses);
  }
  
  public IInvokable getInvokable(String methodName, IBeanTypeProxy[] argumentTypes)
  {
    return getMethodProxy(methodName, argumentTypes);
  }
  
  public IInvokable getInvokable(String methodName, String argumentClassName)
  {
    return getMethodProxy(methodName, argumentClassName);
  }
  
  public IInvokable getInvokable(String methodName, String[] argumentClassNames)
  {
    return getMethodProxy(methodName, argumentClassNames);
  }
  
  public IInvokable getInvokable(String methodName)
  {
    return getMethodProxy(methodName);
  }
  
  public IConstructorProxy getConstructorProxy(String[] argTypeNames)
  {
    IBeanTypeProxy[] argClasses = new IBeanTypeProxy[argTypeNames.length];
    IStandardBeanTypeProxyFactory btFactory = fProxyFactoryRegistry.getBeanTypeProxyFactory();
    for (int i = 0; i < argTypeNames.length; i++)
    {
      argClasses[i] = btFactory.getBeanTypeProxy(argTypeNames[i]);
      if (argClasses[i] == null)
      {
        ProxyPlugin.getPlugin().getLogger().log(
          new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Constructor not found - " + 
          fClass.getName() + " args=" + argTypeNames, null));
        return null;
      }
    }
    return getConstructorProxy(argClasses);
  }
  
  public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] args)
  {
    Class[] argClasses = new Class[args.length];
    for (int i = 0; i < args.length; i++) {
      argClasses[i] = fClass;
    }
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getConstructorProxy(fClass, argClasses);
  }
  
  public IConstructorProxy[] getConstructors()
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getConstructors(fClass);
  }
  
  public IConstructorProxy getDeclaredConstructorProxy(String[] argTypeNames)
  {
    IBeanTypeProxy[] argClasses = new IBeanTypeProxy[argTypeNames.length];
    IStandardBeanTypeProxyFactory btFactory = fProxyFactoryRegistry.getBeanTypeProxyFactory();
    for (int i = 0; i < argTypeNames.length; i++)
    {
      argClasses[i] = btFactory.getBeanTypeProxy(argTypeNames[i]);
      if (argClasses[i] == null)
      {
        ProxyPlugin.getPlugin().getLogger().log(
          new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Constructor not found - " + 
          fClass.getName() + " args=" + argTypeNames, null));
        return null;
      }
    }
    return getDeclaredConstructorProxy(argClasses);
  }
  
  public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] args)
  {
    Class[] argClasses = new Class[args.length];
    for (int i = 0; i < args.length; i++) {
      argClasses[i] = fClass;
    }
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredConstructorProxy(fClass, argClasses);
  }
  
  public IConstructorProxy[] getDeclaredConstructors()
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredConstructors(fClass);
  }
  
  public IBeanTypeProxy getSuperBeanTypeProxy()
  {
    if (fClass.isInterface()) {
      return null;
    }
    return fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(fClass.getSuperclass().getName());
  }
  
  public IFieldProxy[] getFields()
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getFields(fClass);
  }
  
  public IFieldProxy[] getDeclaredFields()
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredFields(fClass);
  }
  
  public IFieldProxy getFieldProxy(String fieldName)
  {
    try
    {
      Field field = fClass.getField(fieldName);
      return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getFieldProxy(field);
    }
    catch (NoSuchFieldException exc)
    {
      ProxyPlugin.getPlugin().getLogger().log(
        new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Field not found " + fClass.getName() + 
        " - " + fieldName, exc));
    }
    return null;
  }
  
  public IFieldProxy getDeclaredFieldProxy(String fieldName)
  {
    try
    {
      Field field = fClass.getDeclaredField(fieldName);
      return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getFieldProxy(field);
    }
    catch (NoSuchFieldException exc)
    {
      ProxyPlugin.getPlugin().getLogger().log(
        new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Field not found " + fClass.getName() + 
        " - " + fieldName, exc));
    }
    return null;
  }
  
  IConstructorProxy getConstructorProxy(Class[] parameterTypes)
  {
    Constructor aConstructor = null;
    try
    {
      aConstructor = fClass.getConstructor(parameterTypes);
    }
    catch (Exception e)
    {
      ProxyPlugin.getPlugin().getLogger().log(new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e));
    }
    if (aConstructor != null) {
      return getNewConstructorProxy(aConstructor);
    }
    return null;
  }
  
  protected IConstructorProxy getNewConstructorProxy(Constructor aConstructor)
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getConstructorProxy(aConstructor);
  }
  
  public IConstructorProxy getNullConstructorProxy()
  {
    Constructor aConstructor = null;
    try
    {
      aConstructor = fClass.getConstructor(null);
      return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getConstructorProxy(aConstructor);
    }
    catch (Exception e)
    {
      ProxyPlugin.getPlugin().getLogger().log(new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e));
    }
    return null;
  }
  
  public IBeanProxy newInstance(String initializationString)
  {
    return ((IDEStandardBeanProxyFactory)fProxyFactoryRegistry.getBeanProxyFactory()).createBeanProxy(this, initializationString);
  }
  
  public IBeanProxy newInstance()
  {
    return ((IDEStandardBeanProxyFactory)fProxyFactoryRegistry.getBeanProxyFactory()).createBeanProxy(this);
  }
  
  protected IIDEBeanProxy newBeanProxy(Object anObject)
  {
    return new IDEObjectBeanProxy(fProxyFactoryRegistry, anObject, this);
  }
  
  public IDEBeanTypeProxy newBeanTypeForClass(Class type)
  {
    return new IDEBeanTypeProxy(fProxyFactoryRegistry, type);
  }
  
  public String getFormalTypeName()
  {
    return getTypeName();
  }
  
  public String getInitializationError()
  {
    return null;
  }
  
  public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes)
    throws AmbiguousMethodException, NoSuchMethodException, IllegalAccessException
  {
    Class[] argClasses = new Class[argumentTypes.length];
    for (int i = 0; i < argumentTypes.length; i++) {
      argClasses[i] = fClass;
    }
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getCompatibleConstructor(fClass, argClasses);
  }
  
  public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes)
    throws NoSuchMethodException, AmbiguousMethodException
  {
    Class[] argClasses = new Class[argumentTypes.length];
    for (int i = 0; i < argumentTypes.length; i++) {
      argClasses[i] = fClass;
    }
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getCompatibleMethod(fClass, methodName, argClasses);
  }
  
  public IProxyMethod getMethodProxy(IExpression expression, String methodName, IProxyBeanType[] parameterTypes)
  {
    IProxyMethod method = ((IDEExpression)expression).getMethodExpressionProxy(this, methodName, parameterTypes);
    if (method == null) {
      method = ((Expression)expression).createMethodExpressionProxy(this, methodName, parameterTypes);
    }
    return method;
  }
  
  public IProxyMethod getMethodProxy(IExpression expression, String methodName, String[] parameterTypes)
  {
    return ((IDEMethodProxyFactory)fProxyFactoryRegistry.getMethodProxyFactory()).getMethodProxy(expression, this, methodName, parameterTypes);
  }
  
  public IProxyMethod getMethodProxy(IExpression expression, String methodName)
  {
    return getMethodProxy(expression, methodName, null);
  }
  
  public IProxyField getFieldProxy(IExpression expression, String fieldName)
  {
    IProxyField field = ((IDEExpression)expression).getFieldExpressionProxy(this, fieldName);
    if (field == null) {
      field = ((Expression)expression).createFieldExpressionProxy(this, fieldName);
    }
    return field;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import java.math.BigDecimal;
import org.eclipse.jem.internal.proxy.core.INumberBeanProxy;

final class IDEBigDecimalBeanTypeProxy
  extends IDENumberBeanTypeProxy
{
  IDEBigDecimalBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass, new BigDecimal(0.0D));
  }
  
  INumberBeanProxy createBigDecimalBeanProxy(BigDecimal aBigDecimal)
  {
    if ((aBigDecimal == null) || (aBigDecimal.intValue() == 0)) {
      return zeroProxy;
    }
    return new IDENumberBeanProxy(fProxyFactoryRegistry, aBigDecimal, this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEBigDecimalBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import java.math.BigInteger;
import org.eclipse.jem.internal.proxy.core.INumberBeanProxy;

final class IDEBigIntegerBeanTypeProxy
  extends IDENumberBeanTypeProxy
{
  IDEBigIntegerBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass, new BigInteger("0"));
  }
  
  INumberBeanProxy createBigIntegerBeanProxy(BigInteger aBigInteger)
  {
    if ((aBigInteger == null) || (aBigInteger.intValue() == 0)) {
      return zeroProxy;
    }
    return new IDENumberBeanProxy(fProxyFactoryRegistry, aBigInteger, this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEBigIntegerBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
import org.eclipse.jem.internal.proxy.core.IBooleanBeanProxy;

class IDEBooleanBeanProxy
  extends IDEObjectBeanProxy
  implements IBooleanBeanProxy
{
  protected Boolean fBooleanValue;
  
  IDEBooleanBeanProxy(IDEProxyFactoryRegistry aRegistry, Object aBean, IBeanTypeProxy aBeanTypeProxy)
  {
    super(aRegistry, aBean, aBeanTypeProxy);
    fBooleanValue = ((Boolean)aBean);
  }
  
  public boolean booleanValue()
  {
    return fBooleanValue.booleanValue();
  }
  
  public Boolean getBooleanValue()
  {
    return fBooleanValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEBooleanBeanProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.IBeanProxy;
import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;

public class IDEBooleanBeanTypeProxy
  extends IDEBooleanBeanProxy
{
  public IDEBooleanBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Object aBean, IBeanTypeProxy aBeanTypeProxy)
  {
    super(aRegistry, aBean, aBeanTypeProxy);
  }
  
  public boolean sameAs(IBeanProxy aBeanProxy)
  {
    return getBooleanValue() == ((IDEBooleanBeanTypeProxy)aBeanProxy).getBooleanValue();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEBooleanBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.IBooleanBeanProxy;

public final class IDEBooleanClassBeanTypeProxy
  extends IDEBeanTypeProxy
{
  protected final IDEBooleanBeanProxy trueProxy;
  protected final IDEBooleanBeanProxy falseProxy;
  
  IDEBooleanClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass);
    trueProxy = new IDEBooleanBeanProxy(fProxyFactoryRegistry, Boolean.TRUE, this);
    falseProxy = new IDEBooleanBeanProxy(fProxyFactoryRegistry, Boolean.FALSE, this);
  }
  
  IBooleanBeanProxy createBooleanBeanProxy(Boolean aBoolean)
  {
    if (aBoolean.booleanValue()) {
      return trueProxy;
    }
    return falseProxy;
  }
  
  protected IIDEBeanProxy newBeanProxy(Object anObject)
  {
    if ((anObject == null) || (anObject == Boolean.FALSE)) {
      return falseProxy;
    }
    return trueProxy;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEBooleanClassBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.IBooleanBeanProxy;

public final class IDEBooleanTypeBeanTypeProxy
  extends IDEPrimitiveBeanTypeProxy
{
  protected final IDEBooleanBeanProxy trueProxy;
  protected final IDEBooleanBeanProxy falseProxy;
  
  IDEBooleanTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass);
    trueProxy = new IDEBooleanBeanTypeProxy(fProxyFactoryRegistry, Boolean.TRUE, this);
    falseProxy = new IDEBooleanBeanTypeProxy(fProxyFactoryRegistry, Boolean.FALSE, this);
  }
  
  IBooleanBeanProxy createBooleanBeanProxy(boolean aBoolean)
  {
    if (aBoolean) {
      return trueProxy;
    }
    return falseProxy;
  }
  
  protected IIDEBeanProxy newBeanProxy(Object anObject)
  {
    return (IIDEBeanProxy)createBooleanBeanProxy(anObject != null ? ((Boolean)anObject).booleanValue() : false);
  }
  
  int getPrimitiveType()
  {
    return 1;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEBooleanTypeBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.INumberBeanProxy;

final class IDEByteClassBeanTypeProxy
  extends IDENumberBeanTypeProxy
{
  protected IDEByteClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass, new Byte((byte)0));
  }
  
  INumberBeanProxy createByteBeanProxy(Byte aByte)
  {
    return new IDENumberBeanProxy(fProxyFactoryRegistry, aByte, this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEByteClassBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.INumberBeanProxy;

final class IDEByteTypeBeanTypeProxy
  extends IDEPrimitiveBeanTypeProxy
{
  protected IDEByteTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass);
  }
  
  INumberBeanProxy createByteBeanProxy(byte aByte)
  {
    return new IDENumberBeanProxy(fProxyFactoryRegistry, new Byte(aByte), this);
  }
  
  int getPrimitiveType()
  {
    return 2;
  }
  
  protected IIDEBeanProxy newBeanProxy(Object anObject)
  {
    Number n = (anObject instanceof Character) ? new Byte((byte)((Character)anObject).charValue()) : (Number)anObject;
    return new IDENumberBeanProxy(fProxyFactoryRegistry, n, this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDEByteTypeBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import java.util.Map;
import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyAdapter;
import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent;

class IDECallbackRegistry$1
  extends ExpressionProxy.ProxyAdapter
{
  final IDECallbackRegistry this$0;
  private final Integer val$callbackID;
  
  IDECallbackRegistry$1(IDECallbackRegistry paramIDECallbackRegistry, Integer paramInteger)
  {
    this$0 = paramIDECallbackRegistry;val$callbackID = paramInteger;
  }
  
  public void proxyResolved(ExpressionProxy.ProxyEvent event)
  {
    this$0.fBeanProxyToCallbackID.put(event.getProxy(), val$callbackID);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDECallbackRegistry.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import java.io.IOException;
import java.io.PipedInputStream;
import java.util.Map;
import org.eclipse.core.runtime.Status;
import org.eclipse.jem.internal.proxy.core.ICallback;
import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
import org.eclipse.jem.util.logger.proxy.Logger;
import org.osgi.framework.Bundle;

class IDECallbackRegistry$2
  extends Thread
{
  final IDECallbackRegistry this$0;
  private final int val$aCallbackID;
  private final PipedInputStream val$inputStream;
  private final int val$aMsgID;
  
  IDECallbackRegistry$2(IDECallbackRegistry paramIDECallbackRegistry, int paramInt1, PipedInputStream paramPipedInputStream, int paramInt2)
  {
    this$0 = paramIDECallbackRegistry;val$aCallbackID = paramInt1;val$inputStream = paramPipedInputStream;val$aMsgID = paramInt2;
  }
  
  public void run()
  {
    ICallback ideCallback = (ICallback)this$0.fCallbackIDToCallback.get(new Integer(val$aCallbackID));
    if (ideCallback != null) {
      try
      {
        ideCallback.calledBackStream(val$aMsgID, val$inputStream);
      }
      finally
      {
        try
        {
          val$inputStream.close();
        }
        catch (IOException exc)
        {
          ProxyPlugin.getPlugin().getLogger().log(new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc));
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDECallbackRegistry.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.Status;
import org.eclipse.jem.internal.proxy.common.IVMCallbackServer;
import org.eclipse.jem.internal.proxy.core.ExpressionProxy;
import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyAdapter;
import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent;
import org.eclipse.jem.internal.proxy.core.IBeanProxy;
import org.eclipse.jem.internal.proxy.core.ICallbackRegistry;
import org.eclipse.jem.internal.proxy.core.IExpression;
import org.eclipse.jem.internal.proxy.core.IProxy;
import org.eclipse.jem.internal.proxy.core.IProxyMethod;
import org.eclipse.jem.internal.proxy.core.IStandardBeanProxyFactory;
import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
import org.eclipse.jem.util.logger.proxy.Logger;
import org.osgi.framework.Bundle;

public class IDECallbackRegistry
  implements ICallbackRegistry
{
  IDEVMServer fVMServer;
  int fNextCallbackID;
  IDEProxyFactoryRegistry fProxyFactoryRegistry;
  Map fCallbackIDToCallback = new HashMap(25);
  Map fBeanProxyToCallbackID = new HashMap(25);
  Map fCallbackIDToStream = new HashMap(25);
  private IProxyMethod initializeCallbackMethodProxy;
  private IBeanProxy vmServerProxy;
  
  IDECallbackRegistry(IDEProxyFactoryRegistry aRegistry)
  {
    fProxyFactoryRegistry = aRegistry;
    fVMServer = new IDEVMServer(this);
    
    vmServerProxy = aRegistry.getBeanProxy(fVMServer.getClass(), fVMServer);
    try
    {
      Method initializeCallbackMethod = tmp82_79.getMethod("initializeCallback", new Class[] { IVMCallbackServer.class, Integer.TYPE });
      initializeCallbackMethodProxy = ((IProxyMethod)aRegistry.getBeanProxy(Method.class, initializeCallbackMethod));
    }
    catch (SecurityException e)
    {
      e.printStackTrace();
    }
    catch (NoSuchMethodException e)
    {
      e.printStackTrace();
    }
  }
  
  public void registerCallback(IBeanProxy aBeanProxy, org.eclipse.jem.internal.proxy.core.ICallback aCallback)
  {
    org.eclipse.jem.internal.proxy.common.ICallback vmCallback = (org.eclipse.jem.internal.proxy.common.ICallback)((IIDEBeanProxy)aBeanProxy).getBean();
    fNextCallbackID += 1;
    int callbackID = fNextCallbackID;
    vmCallback.initializeCallback(
      fVMServer, 
      callbackID);
    Integer callbackIntegerID = new Integer(callbackID);
    fCallbackIDToCallback.put(callbackIntegerID, aCallback);
    fBeanProxyToCallbackID.put(aBeanProxy, callbackIntegerID);
  }
  
  public void registerCallback(IProxy callbackProxy, org.eclipse.jem.internal.proxy.core.ICallback cb, IExpression expression)
  {
    Integer callbackID = new Integer(++fNextCallbackID);
    fCallbackIDToCallback.put(callbackID, cb);
    if (callbackProxy.isBeanProxy()) {
      fBeanProxyToCallbackID.put(callbackProxy, callbackID);
    } else {
      ((ExpressionProxy)callbackProxy).addProxyListener(new ExpressionProxy.ProxyAdapter()
      {
        private final Integer val$callbackID;
        
        public void proxyResolved(ExpressionProxy.ProxyEvent event)
        {
          fBeanProxyToCallbackID.put(event.getProxy(), val$callbackID);
        }
      });
    }
    expression.createSimpleMethodInvoke(initializeCallbackMethodProxy, callbackProxy, new IProxy[] { vmServerProxy, fProxyFactoryRegistry.getBeanProxyFactory().createBeanProxyWith(callbackID.intValue()) }, false);
  }
  
  OutputStream requestStream(int aCallbackID, int aMsgID)
  {
    PipedOutputStream result = new PipedOutputStream();
    PipedInputStream tempStream = null;
    try
    {
      tempStream = new PipedInputStream(result);
    }
    catch (IOException exc)
    {
      ProxyPlugin.getPlugin().getLogger().log(new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc));
      return null;
    }
    PipedInputStream inputStream = tempStream;
    Thread streamProcessor = new Thread()
    {
      private final int val$aCallbackID;
      private final PipedInputStream val$inputStream;
      private final int val$aMsgID;
      
      public void run()
      {
        org.eclipse.jem.internal.proxy.core.ICallback ideCallback = (org.eclipse.jem.internal.proxy.core.ICallback)fCallbackIDToCallback.get(new Integer(val$aCallbackID));
        if (ideCallback != null) {
          try
          {
            ideCallback.calledBackStream(val$aMsgID, val$inputStream);
          }
          finally
          {
            try
            {
              val$inputStream.close();
            }
            catch (IOException exc)
            {
              ProxyPlugin.getPlugin().getLogger().log(new Status(2, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc));
            }
          }
        }
      }
    };
    streamProcessor.start();
    return result;
  }
  
  Object vmCallback(int aCallbackID, int aMsgID, Object[] parms)
  {
    org.eclipse.jem.internal.proxy.core.ICallback ideCallback = (org.eclipse.jem.internal.proxy.core.ICallback)fCallbackIDToCallback.get(new Integer(aCallbackID));
    Object callbackResult = null;
    if (parms.length == 1) {
      callbackResult = ideCallback.calledBack(aMsgID, (IBeanProxy)parms[0]);
    } else {
      callbackResult = ideCallback.calledBack(aMsgID, parms);
    }
    return callbackResult;
  }
  
  Object vmCallback(int aCallbackID, int aMsgID, Object parm)
  {
    org.eclipse.jem.internal.proxy.core.ICallback ideCallback = (org.eclipse.jem.internal.proxy.core.ICallback)fCallbackIDToCallback.get(new Integer(aCallbackID));
    return ideCallback.calledBack(aMsgID, parm);
  }
  
  public void deregisterCallback(IBeanProxy aBeanProxy)
  {
    Integer callbackID = (Integer)fBeanProxyToCallbackID.remove(aBeanProxy);
    fCallbackIDToCallback.remove(callbackID);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDECallbackRegistry
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.ICharacterBeanProxy;

final class IDECharTypeBeanTypeProxy
  extends IDEPrimitiveBeanTypeProxy
{
  protected IDECharTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass);
  }
  
  ICharacterBeanProxy createCharBeanProxy(char aChar)
  {
    return new IDECharacterBeanProxy(fProxyFactoryRegistry, new Character(aChar), this);
  }
  
  int getPrimitiveType()
  {
    return 3;
  }
  
  protected IIDEBeanProxy newBeanProxy(Object anObject)
  {
    Character c = (anObject instanceof Character) ? (Character)anObject : new Character((char)((Number)anObject).intValue());
    return new IDECharacterBeanProxy(fProxyFactoryRegistry, c, this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDECharTypeBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
import org.eclipse.jem.internal.proxy.core.ICharacterBeanProxy;

class IDECharacterBeanProxy
  extends IDEObjectBeanProxy
  implements ICharacterBeanProxy
{
  protected Character fCharacterValue;
  
  IDECharacterBeanProxy(IDEProxyFactoryRegistry aRegistry, Object aBean, IBeanTypeProxy aBeanTypeProxy)
  {
    super(aRegistry, aBean, aBeanTypeProxy);
    fCharacterValue = ((Character)aBean);
  }
  
  public char charValue()
  {
    return fCharacterValue.charValue();
  }
  
  public Character characterValue()
  {
    return fCharacterValue;
  }
  
  public int intValue()
  {
    return charValue();
  }
  
  public byte byteValue()
  {
    return (byte)charValue();
  }
  
  public double doubleValue()
  {
    return charValue();
  }
  
  public float floatValue()
  {
    return charValue();
  }
  
  public long longValue()
  {
    return charValue();
  }
  
  public Number numberValue()
  {
    return new Integer(charValue());
  }
  
  public short shortValue()
  {
    return (short)charValue();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDECharacterBeanProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.ICharacterBeanProxy;

final class IDECharacterClassBeanTypeProxy
  extends IDEBeanTypeProxy
{
  protected IDECharacterClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass);
  }
  
  ICharacterBeanProxy createCharacterBeanProxy(Character aChar)
  {
    return new IDECharacterBeanProxy(fProxyFactoryRegistry, aChar, this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.proxy.ide.IDECharacterClassBeanTypeProxy
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.proxy.ide;

import org.eclipse.jem.internal.proxy.core.IBeanProxy;

public class IDEClassBeanTypeProxy
  extends IDEBeanTypeProxy
{
  public IDEClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass)
  {
    super(aRegistry, aClass);
  }
  
  protected IIDEBeanProxy newBeanProxy(Object anObject)
  {
    return (IIDEBeanProxy)((IDEStandardBeanTypeProxyFactory)fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy((Class)anObject);
  }
  
  public IDEBeanTypeProxy newBeanTypeForClass(Class type)
  {
    throw new UnsupportedOperationExce
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd