Package java.lang.reflect

Examples of java.lang.reflect.AccessibleObject


                           Conventions conventions) {

        writeAttributes(source, objectContext, context, conventions);
        Object value = null;
        if (!(source instanceof Long)) {
            AccessibleObject accessor = objectContext.getAccessor(Value.class, conventions);
            if (accessor != null) {
                value = eval(accessor, source);
            }
        }
        writeValue(value != null ? value : source, context);
View Full Code Here


        StreamWriter sw = context.getStreamWriter();
        Link _link = objectContext.getAnnotation(Link.class);

        String rel = null;
        AccessibleObject accessor = objectContext.getAccessor(Rel.class, conventions);
        if (accessor != null) {
            Object value = eval(accessor, source);
            if (value != null)
                rel = toString(value);
        }
View Full Code Here

    protected void process(Object source,
                           ObjectContext objectContext,
                           SerializationContext context,
                           Conventions conventions) {
        writeAttributes(source, objectContext, context, conventions);
        AccessibleObject accessor = objectContext.getAccessor(Draft.class, conventions);
        if (accessor != null) {
            Object value = eval(accessor, source);
            if (value instanceof Boolean) {
                String val = ((Boolean)value).booleanValue() ? "yes" : "no";
                ObjectContext valueContext = new ObjectContext(val);
View Full Code Here

        writeAttributes(source, objectContext, context, conventions);
        StreamWriter sw = context.getStreamWriter();
        Generator _generator = objectContext.getAnnotation(Generator.class);

        String uri = null;
        AccessibleObject accessor = objectContext.getAccessor(URI.class, conventions);
        if (accessor != null) {
            Object value = eval(accessor, source);
            if (value != null)
                uri = toString(value);
        }
View Full Code Here

    @Override
    protected <T> T resolveActual(String var) {
        try {
            var = var.toLowerCase();
            AccessibleObject accessor = accessors.get(var);
            if (accessor == null)
                return null;
            if (accessor instanceof Method) {
                Method method = (Method)accessor;
                return (T)method.invoke(target);
View Full Code Here

    @Override
    protected <T> T resolveActual(String var) {
        try {
            var = var.toLowerCase();
            AccessibleObject accessor = accessors.get(var);
            if (accessor == null)
                return null;
            if (accessor instanceof Method) {
                Method method = (Method)accessor;
                return (T)method.invoke(target);
View Full Code Here

      final int sep = objSpec.indexOf('|');
      if (sep == -1)
        return objSpec;
      final String type = objSpec.substring(0, sep);
      final String spec = objSpec.substring(sep + 1);
      final AccessibleObject factory = getFactory(type);
      if (factory instanceof Method)
        return ((Method) factory).invoke(null, spec);
      return ((Constructor<?>) factory).newInstance(spec);
    }
    catch (Exception e) {
View Full Code Here

      }
      if (!javaDispatch.isMethod(dispId)) {
    return null;
      }
      final MethodAdaptor method = javaDispatch.getMethod(dispId);
      AccessibleObject obj = method.getUnderlyingObject();
      DispatchMethod dispMethod = (DispatchMethod) classLoader.getWrapperForObject(obj);
      if (dispMethod == null) {
      dispMethod = new MethodDispatch(classLoader, method);
      classLoader.putWrapperForObject(obj, dispMethod);
      }
View Full Code Here

        // Native code will eat an extra ref.
        LowLevelWebKit.gcProtect(jsContext, jsval);
        return jsval;
      } else {
        MethodAdaptor method = javaDispatch.getMethod(dispId);
        AccessibleObject obj = method.getUnderlyingObject();
        DispatchMethod<?> dispMethod =
            (DispatchMethod<?>) WrappersCache.getWrapperForObject(classLoader, obj);
        if (dispMethod == null) {
          dispMethod = new MethodDispatch<H>(classLoader, dispIdOracle, method);
          WrappersCache.putWrapperForObject(classLoader, obj, dispMethod);
View Full Code Here

      if (!encName.startsWith("env/"))
      {
         encName = "env/" + encName;
      }

      AccessibleObject accObj = property.getAccessibleObject();
     
      Class<?> type = property.getType();
      if (!ref.type().equals(Object.class))
      {
         type = ref.type();
View Full Code Here

TOP

Related Classes of java.lang.reflect.AccessibleObject

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.