Examples of FieldAccessor


Examples of com.caucho.jaxb.accessor.FieldAccessor

          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.caucho.jaxb.accessor.FieldAccessor

          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.comphenix.protocol.reflect.accessors.FieldAccessor

    TileEntityAccessor<?> accessor = cachedAccessors.get(craftBlockState);
   
    // Attempt to construct the accessor
    if (accessor == null ) {
      TileEntityAccessor<?> created = null;
      FieldAccessor field = null;
     
      try {
        field = Accessors.getFieldAccessor(craftBlockState, MinecraftReflection.getTileEntityClass(), true);
      } catch (Exception e) {
        created = EMPTY_ACCESSOR;
View Full Code Here

Examples of com.comphenix.protocol.reflect.accessors.FieldAccessor

   * Note that this may not exist in the current Minecraft version.
   * @param player - the player.
   * @return The game profile.
   */
  public static WrappedGameProfile fromPlayer(Player player) {
    FieldAccessor accessor = PLAYER_PROFILE;
    Object nmsPlayer = BukkitUnwrapper.getInstance().unwrapItem(player);
   
    if (accessor == null) {
      accessor = Accessors.getFieldAccessor(MinecraftReflection.getEntityHumanClass(), GameProfile.class, true);
      PLAYER_PROFILE = accessor;
View Full Code Here

Examples of com.comphenix.protocol.reflect.accessors.FieldAccessor

   * Note that this may not exist in the current Minecraft version.
   * @param player - the offline player.
   * @return The game profile.
   */
  public static WrappedGameProfile fromOfflinePlayer(OfflinePlayer player) {
    FieldAccessor accessor = OFFLINE_PROFILE;
   
    if (accessor == null) {
      accessor = Accessors.getFieldAccessor(player.getClass(), GameProfile.class, true);
      OFFLINE_PROFILE = accessor;
    }
View Full Code Here

Examples of com.comphenix.protocol.reflect.accessors.FieldAccessor

   * @param packetClass - the packet class.
   * @param packet - the packet.
   */
  protected void handleLogin(Class<?> packetClass, Object packet) {
    Class<?> loginClass = PACKET_LOGIN_CLIENT;
    FieldAccessor loginClient = LOGIN_GAME_PROFILE;
   
    // Initialize packet class and login
    if (loginClass == null) {
      loginClass = PacketType.Login.Client.START.getPacketClass();
      PACKET_LOGIN_CLIENT = loginClass;
    }
    if (loginClient == null) {
      loginClient = Accessors.getFieldAccessor(PACKET_LOGIN_CLIENT, GameProfile.class, true);
      LOGIN_GAME_PROFILE = loginClient;
    }
     
    // See if we are dealing with the login packet
    if (loginClass.equals(packetClass)) {
      GameProfile profile = (GameProfile) loginClient.get(packet);
     
      // Save the channel injector
      factory.cacheInjector(profile.getName(), this);
    }
  }
View Full Code Here

Examples of com.comphenix.protocol.reflect.accessors.FieldAccessor

          return delegate.eventLoop();
        }
       
        @Override
        protected Runnable schedulingRunnable(final Runnable runnable) {
          final FieldAccessor accessor = getMessageAccessor(runnable);
         
          if (accessor != null) {
            Runnable result = onMessageScheduled(runnable, accessor);;
            return result != null ? result : getEmptyRunnable();
          }
          return runnable;
        }
       
        @Override
        protected <T> Callable<T> schedulingCallable(Callable<T> callable) {
          FieldAccessor accessor = getMessageAccessor(callable);
         
          if (accessor != null) {
            Callable<T> result = onMessageScheduled(callable, accessor);;
            return result != null ? result : EventLoopProxy.<T>getEmptyCallable();
          }
View Full Code Here

Examples of com.comphenix.protocol.reflect.accessors.FieldAccessor

   * @param value - the object.
   * @return The packet field accessor, or NULL if not found.
   */
  private FieldAccessor getMessageAccessor(Object value) { 
    Class<?> clazz = value.getClass();
    FieldAccessor accessor = MESSAGE_LOOKUP.get(clazz);
   
    if (accessor == null) {
      try {
        accessor = Accessors.getFieldAccessor(clazz, messageClass, true);
      } catch (IllegalArgumentException e) {
View Full Code Here

Examples of com.comphenix.protocol.reflect.accessors.FieldAccessor

    assertEquals(obj.mode, roundtrip(obj, "mode", EnumWrappers.getGameModeConverter()) );
  }

  @SuppressWarnings("unchecked")
  public <T extends Enum<T>> T roundtrip(Object target, String fieldName, EquivalentConverter<T> converter) {
    FieldAccessor accessor = Accessors.getFieldAccessor(target.getClass(), fieldName, true);
   
    return (T) converter.getGeneric(
      accessor.getField().getType(),
      converter.getSpecific(accessor.get(target))
    );
  }
View Full Code Here

Examples of com.senseidb.search.req.mapred.FieldAccessor

   */
  @Override
  public void mapFullIndexReader(BoboIndexReader reader, FacetCountCollector[] facetCountCollectors) {
    ZoieSegmentReader<?> zoieReader = (ZoieSegmentReader<?>)(reader.getInnerReader());
    DocIDMapperImpl docIDMapper = (DocIDMapperImpl) zoieReader.getDocIDMaper();
    result.getMapResults().add(mapReduceStrategy.map(docIDMapper.getDocArray(), docIDMapper.getDocArray().length, zoieReader.getUIDArray(), new FieldAccessor(facetInfos, reader, docIDMapper), new FacetCountAccessor(facetCountCollectors)));   
  }
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.