Examples of Accessor


Examples of com.caucho.jaxb.accessor.Accessor

            continue;

          get.setAccessible(true);
          set.setAccessible(true);

          Accessor a = new GetterSetterAccessor(name, get, set);

          if (orderMap != null) {
            Integer i = orderMap.remove(name);

            if (i != null)
              a.setOrder(i.intValue());
            // XXX else throw something?
          }

          processAccessor(a);
        }
      }

      if (accessType != XmlAccessType.PROPERTY) {
        // XXX Don't overwrite property accessors
        HashSet<Field> fieldSet = new HashSet<Field>();

        Field[] declared = _class.getDeclaredFields();

        for (Field f : declared)
          fieldSet.add(f);

        Field[] fields = new Field[fieldSet.size()];
        fieldSet.toArray(fields);

        AccessibleObject.setAccessible(fields, true);

        for (Field f : fields) {
          if (f.isAnnotationPresent(XmlLocation.class))
          {
            if (! f.getType().equals(Location.class))
              throw new JAXBException(L.l("Fields annotated by @Location must have type javax.xml.stream.Location"));

            _locationAccessor = new FieldAccessor(f);
          }

          // special case: jaxb/0250
          // fields which are static are skipped _unless_ they are also
          // both final and attributes
          if (Modifier.isStatic(f.getModifiers()) &&
              ! (Modifier.isFinal(f.getModifiers()) &&
                 f.isAnnotationPresent(XmlAttribute.class)))
            continue;

          if (f.isAnnotationPresent(XmlTransient.class))
            continue;
          // jaxb/0176: transient modifier ignored

          if (accessType == XmlAccessType.PUBLIC_MEMBER &&
              ! Modifier.isPublic(f.getModifiers()) &&
              ! JAXBUtil.isJAXBAnnotated(f))
            continue;

          if (accessType == XmlAccessType.NONE && ! JAXBUtil.isJAXBAnnotated(f))
            continue;

          Accessor a = new FieldAccessor(f);

          if (orderMap != null) {
            Integer i = orderMap.remove(f.getName());

            if (i != null)
              a.setOrder(i.intValue());
            // XXX else throw something?
          }

          processAccessor(a);
        }
View Full Code Here

Examples of com.github.nmorel.gwtjackson.rebind.property.FieldAccessor.Accessor

        source.println();

        for ( Entry<PropertyInfo, JDeserializerType> entry : properties.entrySet() ) {
            PropertyInfo property = entry.getKey();

            Accessor accessor = property.getSetterAccessor().get().getAccessor( "bean" );

            source.println( "map.put(\"%s\", new %s<%s, %s>() {", property.getPropertyName(), BEAN_PROPERTY_DESERIALIZER_CLASS, beanInfo
                    .getType().getParameterizedQualifiedSourceName(), getParameterizedQualifiedClassName( property.getType() ) );

            source.indent();

            generateCommonPropertyDeserializerBody( source, property, entry.getValue() );

            source.println();

            source.println( "@Override" );
            source.println( "public void setValue(%s bean, %s value, %s ctx) {", beanInfo.getType()
                    .getParameterizedQualifiedSourceName(), getParameterizedQualifiedClassName( property
                    .getType() ), JSON_DESERIALIZATION_CONTEXT_CLASS );
            source.indent();
            source.println( accessor.getAccessor() + ";", "value" );

            if ( property.getManagedReference().isPresent() ) {
                source.println( "getDeserializer().setBackReference(\"%s\", bean, value, ctx);", property.getManagedReference().get() );
            }

            source.outdent();
            source.println( "}" );

            if ( accessor.getAdditionalMethod().isPresent() ) {
                source.println();
                accessor.getAdditionalMethod().get().write( source );
            }

            source.outdent();
            source.println( "});" );
            source.println();
View Full Code Here

Examples of com.google.gwt.rpc.server.CommandSerializationUtil.Accessor

      throws SerializationException {
    if (value == null) {
      return NullValueCommand.INSTANCE;
    }

    Accessor accessor;

    if (identityMap.containsKey(value)) {
      return identityMap.get(value);

    } else if ((accessor = CommandSerializationUtil.getAccessor(type)).canMakeValueCommand()) {
      return accessor.makeValueCommand(value);

    } else if (type.isArray()) {
      return makeArray(type, value);

    } else if (Enum.class.isAssignableFrom(type)) {
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.reflect.Accessor

        if(!(bi instanceof ClassBeanInfoImpl))
            throw new JAXBException(wrapperBean+" is not a bean");

        for( ClassBeanInfoImpl cb = (ClassBeanInfoImpl) bi; cb!=null; cb=cb.superClazz) {
            for (Property p : cb.properties) {
                final Accessor acc = p.getElementPropertyAccessor(nsUri,localName);
                if(acc!=null)
                    return new RawAccessor() {
                        // Accessor.set/get are designed for unmarshaller/marshaller, and hence
                        // they go through an adapter behind the scene.
                        // this isn't desirable for JAX-WS, which essentially uses this method
                        // just as a reflection library. So use the "unadapted" version to
                        // achieve the desired semantics
                        public Object get(Object bean) throws AccessorException {
                            return acc.getUnadapted(bean);
                        }

                        public void set(Object bean, Object value) throws AccessorException {
                            acc.setUnadapted(bean,value);
                        }
                    };
            }
        }
        throw new JAXBException(new QName(nsUri,localName)+" is not a valid property on "+wrapperBean);
View Full Code Here

Examples of com.sun.xml.internal.bind.v2.runtime.reflect.Accessor

    private NonElement<T,C> type;

    public SingleTypePropertyInfoImpl(ClassInfoImpl<T,C,F,M> classInfo, PropertySeed<T,C,F,M> seed) {
        super(classInfo, seed);
        if(this instanceof RuntimePropertyInfo) {
            Accessor rawAcc = ((RuntimeClassInfoImpl.RuntimePropertySeed)seed).getAccessor();
            if(getAdapter()!=null && !isCollection())
                // adapter for a single-value property is handled by accessor.
                // adapter for a collection property is handled by lister.
                rawAcc = rawAcc.adapt(((RuntimePropertyInfo)this).getAdapter());
            this.acc = rawAcc;
        } else
            this.acc = null;
    }
View Full Code Here

Examples of de.ailis.jollada.model.Accessor

    {
        final DataFlowSource source = new DataFlowSource("ID");
        source.setCommonTechnique(null);
        assertNull(source.getCommonTechnique());
        final CommonSourceTechnique technique = new CommonSourceTechnique(
            new Accessor(new URI("SOURCE"), 0));
        source.setCommonTechnique(technique);
        assertSame(technique, source.getCommonTechnique());
        source.setCommonTechnique(null);
        assertNull(source.getCommonTechnique());
    }
View Full Code Here

Examples of de.danielbechler.diff.access.Accessor

  }

  @Test
  public void testAssertThat_child_at_property_names_does_exist_succeeds_when_child_exists()
  {
    final Accessor accessor = mock(Accessor.class);
    when(accessor.getElementSelector()).thenReturn(new BeanPropertyElementSelector("value"));
    final DiffNode node = new DiffNode(ObjectWithString.class);
    final DiffNode child = new DiffNode(node, accessor, String.class);
    node.addChild(child);
    assertThat(node).child("value").doesExist();
  }
View Full Code Here

Examples of io.airlift.airline.Accessor

        }
        else {
            this.allowedValues = null;
        }

        this.accessors = ImmutableSet.of(new Accessor(path));
    }
View Full Code Here

Examples of nexj.core.meta.Accessor

    * @param reader The reader object.
    * @return True if the query should be executed.
    */
   protected boolean isEnabled(Accessor reader)
   {
      Accessor dispGroup = (Accessor)reader.getValue("dispatchGroup");

      if (dispGroup != null)
      {
         boolean bDispatched = ((Boolean)dispGroup.getValue("dispatched")).booleanValue();

         if (dispGroup == reader)
         {
            if (bDispatched)
            {
               return false;
            }
         }
         else if (((Boolean)reader.getValue("dispatched")).booleanValue() != bDispatched)
         {
            return false;
         }
      }

      Accessor dispParent = (Accessor)reader.getValue("dispatchParent");

      if (dispParent == null)
      {
         if (dispGroup != null && reader != dispGroup)
         {
            reader.setValue("dispatched", Boolean.TRUE);
         }

         return true;
      }

      InstanceList resultList = (InstanceList)dispParent.getValue("results");

      if (resultList == null || resultList.isEmpty())
      {
         return false;
      }

      dispParent = resultList.getInstance(0);

      Pair dispAssoc = (Pair)reader.getValue("dispatchAttribute");
      Pair dispValues = (Pair)reader.getValue("dispatchValues");

      if (dispAssoc == null)
      {
         Metaclass metaclass = dispParent.getMetaclass();

         for (; dispValues != null; dispValues = dispValues.getNext())
         {
            if (m_context.getMetadata().getMetaclass(((Symbol)dispValues.getHead()).getName()).isUpcast(metaclass))
            {
               if (dispGroup != null)
               {
                  dispGroup.setValue("dispatched", Boolean.TRUE);

                  if (reader != dispGroup)
                  {
                     reader.setValue("dispatched", Boolean.TRUE);
                  }
               }

               return true;
            }
         }

         return false;
      }

      Object value;

      for (value = dispParent; value != null && dispAssoc != null; dispAssoc = dispAssoc.getNext())
      {
         dispParent = (Accessor)value;

         Attribute attribute = dispParent.getMetaclass().getAttribute(((Symbol)dispAssoc.getHead()).getName());

         attribute.checkReadAccess(m_context.getPrivilegeSet());
         value = dispParent.getValue(attribute.getOrdinal());
      }

      for (; dispValues != null; dispValues = dispValues.getNext())
      {
         if (Intrinsic.equal(value, dispValues.getHead()))
View Full Code Here

Examples of oracle.toplink.internal.databaseaccess.Accessor

        logger.debug("TopLink Session [" + session +
            "] does not derive from [oracle.toplink.publicinterface.Session]");
      }
      return null;
    }
    Accessor accessor = ((oracle.toplink.publicinterface.Session) session).getAccessor();
    if (!(accessor instanceof DatabaseAccessor)) {
      if (logger.isDebugEnabled()) {
        logger.debug("TopLink Accessor [" + accessor +
            "] does not derive from [oracle.toplink.internal.databaseaccess.DatabaseAccessor]");
      }
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.