/** * To create a protobuf proxy class for target class. * * @param <T> generic type * @param cls target class to parse <code>@Protobuf</code> annotation * @return {@link Codec} instance proxy */ public static <T> Codec<T> create(Class<T> cls) { return create(cls, isDebugEnabled()); }
/** * Creates the single. * * @param reader the reader * @return the IDL proxy object * @throws IOException Signals that an I/O exception has occurred. */ public static IDLProxyObject createSingle(Reader reader) throws IOException { return createSingle(reader, false); }
/** * Put. * * @param fullField the full field * @param field the field * @param value the value * @param object the object * @return the IDL proxy object */ private IDLProxyObject put(String fullField, String field, Object value, Object object) { return doSetFieldValue(fullField, field, value, object, this.cached, this.cachedFields); }
/** * Encode. * * @return the byte[] * @throws IOException Signals that an I/O exception has occurred. */ public byte[] encode() throws IOException { return codec.encode(target); }
/** * To generate a protobuf proxy java source code for target class. * * @param os to generate java source code * @param cls target class * @param charset charset type * @throws IOException in case of any io relative exception. */ public static void dynamicCodeGenerate(OutputStream os, Class cls, Charset charset) throws IOException { dynamicCodeGenerate(os, cls, charset, getCodeGenerator(cls)); }
@Override public void outputWriteToStream(Object output, CodedOutputStream stream) throws IOException { if (outputCodec != null) { outputCodec.writeTo(output, stream); } }
/** * Creates the. * * @param reader the reader * @param debug the debug * @param path the path * @return the map * @throws IOException Signals that an I/O exception has occurred. */ public static Map<String, IDLProxyObject> create(Reader reader, boolean debug, File path) throws IOException { return create(reader, debug, path, true); }
/** * Gets the. * * @param field the field * @return the object */ public Object get(String field) { if (target == null) { return null; } return get(field, field, target); }
/** * Gets the. * * @param fullField the full field * @param field the field * @param object the object * @return the object */ private Object get(String fullField, String field, Object object) { return doGetFieldValue(fullField, field, object, this.cached, this.cachedFields); }
/** * Gets the input proxy object. * * @return the input proxy object */ public IDLProxyObject getInputProxyObject() { if (inputIDLProxyObject != null) { return inputIDLProxyObject.newInstnace(); } return inputIDLProxyObject; }
/** * Creates the. * * @param data the data * @param debug the debug * @return the map */ public static Map<String, IDLProxyObject> create(String data, boolean debug) { return create(data, debug, null, true); }
/** * Creates the single. * * @param data the data * @param debug the debug * @return the IDL proxy object */ public static IDLProxyObject createSingle(String data, boolean debug) { return createSingle(data, debug, null, true); }
/** * Creates the. * * @param file the file * @param debug the debug * @param isUniName the is uni name * @return the map * @throws IOException Signals that an I/O exception has occurred. */ public static Map<String, IDLProxyObject> create(File file, boolean debug, boolean isUniName) throws IOException { return create(file, debug, null, true); }
/** * Creates the single. * * @param data the data * @param debug the debug * @param path the path * @return the IDL proxy object */ public static IDLProxyObject createSingle(String data, boolean debug, File path) { return createSingle(data, debug, path, true); }
/** * Creates the. * * @param is the is * @param debug the debug * @param path the path * @return the map * @throws IOException Signals that an I/O exception has occurred. */ public static Map<String, IDLProxyObject> create(InputStream is, boolean debug, File path) throws IOException { return create(is, debug, path, true); }
/** * Creates the single. * * @param is the is * @param debug the debug * @param isUniName the is uni name * @return the IDL proxy object * @throws IOException Signals that an I/O exception has occurred. */ public static IDLProxyObject createSingle(InputStream is, boolean debug, boolean isUniName) throws IOException { return createSingle(is, debug, null, isUniName); }
/** * Creates the. * * @param reader the reader * @return the map * @throws IOException Signals that an I/O exception has occurred. */ public static Map<String, IDLProxyObject> create(Reader reader) throws IOException { return create(reader, false); }
/** * Creates the single. * * @param reader the reader * @param debug the debug * @param path the path * @return the IDL proxy object * @throws IOException Signals that an I/O exception has occurred. */ public static IDLProxyObject createSingle(Reader reader, boolean debug, File path) throws IOException { return createSingle(reader, debug, path, true); }
/** * Creates the. * * @param data the data * @param debug the debug * @param isUniName the is uni name * @return the map */ public static Map<String, IDLProxyObject> create(String data, boolean debug, boolean isUniName) { return create(data, debug, null, isUniName); }