Package java.lang.reflect

Examples of java.lang.reflect.Field$FieldData


      }
    });
   
    // SWT.OpenDocument is only available on 3637
    try {
      Field fldOpenDoc = SWT.class.getDeclaredField("OpenDocument");
      int SWT_OpenDocument = fldOpenDoc.getInt(null);

      display.addListener(SWT_OpenDocument, new Listener() {
        public void handleEvent(final Event event) {
          AzureusCoreFactory.addCoreRunningListener(new AzureusCoreRunningListener() {
            public void azureusCoreRunning(AzureusCore core) {
View Full Code Here


        // Not on bootclasspath
        if(UnsafeUtils.class.getClassLoader() == null) {
            return Unsafe.getUnsafe();
        }
        try {
            final Field fld = Unsafe.class.getDeclaredField("theUnsafe");
            fld.setAccessible(true);
            return (Unsafe) fld.get(UnsafeUtils.class);
        } catch (Exception e) {
            return null;
        }
    }
View Full Code Here

                done_something = true;
             
                System.setProperty( "java.net.preferIPv6Addresses", prefer_ipv6?"true":"false" );
               
                try{
                  Field field = InetAddress.class.getDeclaredField( "preferIPv6Address" );
                 
                  field.setAccessible( true );
                 
                  field.setBoolean( null, prefer_ipv6 );
                 
                }catch( Throwable e ){
                 
                  Debug.out( "Failed to update 'preferIPv6Address'", e );
                }
View Full Code Here

     * @return the value as a string
     */
    protected static String getStaticField(String className, String fieldName) {
        try {
            Class<?> clazz = Class.forName(className);
            Field field = clazz.getField(fieldName);
            return field.get(null).toString();
        } catch (Exception e) {
            throw new RuntimeException("Can not read field " + className + "." + fieldName, e);
        }
    }
View Full Code Here

                                                                    null,null);
                            emd.addMember(apmd);
                            try
                            {
                                //needs to do the same for methods
                                Field overrideField = member.getType().getDeclaredField(attributeOverride[j].name());
                                apmd.addColumn(JPAAnnotationUtils.getColumnMetaDataForColumnAnnotation(apmd,
                                    new Member(overrideField), attributeOverride[j].column()));
                            }
                            catch (SecurityException e)
                            {
View Full Code Here

                    size = sizeOfPrimitive(o.getClass());
                } else {
                    processedObjects.add(ow);
                    Class clazz = o.getClass();
                    while (clazz != null) {
                        Field fields[] = clazz.getDeclaredFields();
                        for (int i = 0; i < fields.length; i++) {
                            Field f = fields[i];
                            if ((f.getModifiers() & Modifier.STATIC) == 0) {
                                if (f.getType().isPrimitive()) {
                                    size += sizeOfPrimitive(f.getType());
                                } else {
                                    Object val = ACCESSOR.get(o, f);
                                    if (f.getType().isArray()) {
                                        size += sizeOfArray(val);
                                    } else {
                                        size += internalSizeOf(val);
                                        size += SZ_REF;
                                    }
View Full Code Here

        return ACCESSOR != null;
    }

    public static Object getField(Object o, String name) {
        if (isInitialized()) {
            Field f = findField(o.getClass(), name);
            if (f != null) {
                return ACCESSOR.get(o, f);
            }
        }
        return null;
View Full Code Here

  }

  @Override
  public void connect() {
    try {
      final Field field = WSHumanTaskHandler.class.getDeclaredField("client");
      TaskClient client = (TaskClient) field.get(this);
      if (client == null) {
        client = new TaskClient(new JMSTaskClientConnector(
            "org.drools.process.workitem.wsht.WSThroughJMSHumanTaskHandler",
            new JMSTaskClientHandler(SystemEventListenerFactory
                .getSystemEventListener()),
            WSHumanTaskJMSProperties.getInstance().getProperties(),
            new InitialContext(WSHumanTaskJMSProperties.getInstance().getProperties())));
        field.set(this, client);
        boolean connected = client.connect();
        if (!connected) {
          throw new IllegalArgumentException("Could not connect to the task client");
        }
      }
View Full Code Here

  }
 
  @Override
  public void connect() {
    try {
      final Field field = WSHumanTaskHandler.class.getDeclaredField("client");
      TaskClient client = (TaskClient) field.get(this);
      if (client == null) {
        client = new TaskClient(new JMSTaskClientConnector(
            "org.jbpm.process.workitem.wsht.WSThroughJMSHumanTaskHandler",
            new JMSTaskClientHandler(SystemEventListenerFactory
                .getSystemEventListener()),
            WSHumanTaskJMSProperties.getInstance().getProperties(),
            new InitialContext(WSHumanTaskJMSProperties.getInstance().getProperties())));
        field.set(this, client);
        boolean connected = client.connect();
        if (!connected) {
          throw new IllegalArgumentException("Could not connect to the task client");
        }
      }
View Full Code Here

      return methods;
    }

    public IBytecodeField getField(BytecodeResolutionPool pool, String name) {
      try {
        Field field = clazz.getDeclaredField(name);
        return new BytecodeFieldDeclared(pool, this, field);
      } catch (SecurityException e) {
        throw new BytecodeException("Could not access field: " + name, e);
      } catch (NoSuchFieldException e) {
        if (this.superType != null) {
View Full Code Here

TOP

Related Classes of java.lang.reflect.Field$FieldData

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.