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

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Socket (java.net)
    Provides a client-side TCP socket.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • 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