congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Serializable.serializer
Code IndexAdd Tabnine to your IDE (free)

How to use
serializer
method
in
com.jme3.network.serializing.Serializable

Best Java code snippets using com.jme3.network.serializing.Serializable.serializer (Showing top 3 results out of 315)

origin: jMonkeyEngine/jmonkeyengine

/**
 *  Registers the specified class. The failOnMiss flag controls whether or
 *  not this method returns null for failed registration or throws an exception.
 */
@SuppressWarnings("unchecked")
public static SerializerRegistration registerClass(Class cls, boolean failOnMiss) {
  if (cls.isAnnotationPresent(Serializable.class)) {
    Serializable serializable = (Serializable)cls.getAnnotation(Serializable.class);
    Class serializerClass = serializable.serializer();
    short classId = serializable.id();
    if (classId == 0) classId = nextId();
    Serializer serializer = getSerializer(serializerClass, false);
    if (serializer == null) serializer = fieldSerializer;
    SerializerRegistration existingReg = getExactSerializerRegistration(cls);
    if (existingReg != null) classId = existingReg.getId();
    
    SerializerRegistration reg = new SerializerRegistration(serializer, cls, classId);
    return registerClassForId( classId, cls, serializer );
  }
  if (failOnMiss) {
    throw new IllegalArgumentException( "Class is not marked @Serializable:" + cls );            
  }
  return null;
}
origin: info.projectkyoto/mms-engine

/**
 *  Registers the specified class. The failOnMiss flag controls whether or
 *  not this method returns null for failed registration or throws an exception.
 */
@SuppressWarnings("unchecked")
public static SerializerRegistration registerClass(Class cls, boolean failOnMiss) {
  if (cls.isAnnotationPresent(Serializable.class)) {
    Serializable serializable = (Serializable)cls.getAnnotation(Serializable.class);
    Class serializerClass = serializable.serializer();
    short classId = serializable.id();
    if (classId == 0) classId = --nextId;
    Serializer serializer = getSerializer(serializerClass, false);
    if (serializer == null) serializer = fieldSerializer;
    SerializerRegistration existingReg = getExactSerializerRegistration(cls);
    if (existingReg != null) classId = existingReg.getId();
    SerializerRegistration reg = new SerializerRegistration(serializer, cls, classId);
    idRegistrations.put(classId, reg);
    classRegistrations.put(cls, reg);
    serializer.initialize(cls);
    log.log( Level.INFO, "Registered class[" + classId + "]:{0}.", cls );
    return reg;
  }
  if (failOnMiss) {
    throw new IllegalArgumentException( "Class is not marked @Serializable:" + cls );            
  }
  return null;
}
origin: org.jmonkeyengine/jme3-networking

/**
 *  Registers the specified class. The failOnMiss flag controls whether or
 *  not this method returns null for failed registration or throws an exception.
 */
@SuppressWarnings("unchecked")
public static SerializerRegistration registerClass(Class cls, boolean failOnMiss) {
  if (cls.isAnnotationPresent(Serializable.class)) {
    Serializable serializable = (Serializable)cls.getAnnotation(Serializable.class);
    Class serializerClass = serializable.serializer();
    short classId = serializable.id();
    if (classId == 0) classId = nextId();
    Serializer serializer = getSerializer(serializerClass, false);
    if (serializer == null) serializer = fieldSerializer;
    SerializerRegistration existingReg = getExactSerializerRegistration(cls);
    if (existingReg != null) classId = existingReg.getId();
    
    SerializerRegistration reg = new SerializerRegistration(serializer, cls, classId);
    return registerClassForId( classId, cls, serializer );
  }
  if (failOnMiss) {
    throw new IllegalArgumentException( "Class is not marked @Serializable:" + cls );            
  }
  return null;
}
com.jme3.network.serializingSerializableserializer

Popular methods of Serializable

  • <init>
  • id

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now