repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java
BindDataSourceBuilder.generateRxInterface
private void generateRxInterface(String daoFactory, RxInterfaceType interfaceType, Class<?> clazz) { // create interfaces { ParameterizedTypeName parameterizedTypeName = ParameterizedTypeName.get(ClassName.get(clazz), TypeVariableName.get("T")); String preExecutorName = clazz.getSimpleName().replace("Emi...
java
private void generateRxInterface(String daoFactory, RxInterfaceType interfaceType, Class<?> clazz) { // create interfaces { ParameterizedTypeName parameterizedTypeName = ParameterizedTypeName.get(ClassName.get(clazz), TypeVariableName.get("T")); String preExecutorName = clazz.getSimpleName().replace("Emi...
[ "private", "void", "generateRxInterface", "(", "String", "daoFactory", ",", "RxInterfaceType", "interfaceType", ",", "Class", "<", "?", ">", "clazz", ")", "{", "// create interfaces", "{", "ParameterizedTypeName", "parameterizedTypeName", "=", "ParameterizedTypeName", "...
Generate rx interface. @param daoFactory the dao factory @param interfaceType the interface type @param clazz the clazz
[ "Generate", "rx", "interface", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L1311-L1347
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java
BindSharedPreferencesBuilder.generateEditor
private static void generateEditor(PrefsEntity entity) { com.abubusoft.kripton.common.Converter<String, String> converter = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL); Builder innerClassBuilder = TypeSpec.classBuilder("BindEditor").addModifiers(Modifier.PUBLIC).addJavadoc("editor class for shared pr...
java
private static void generateEditor(PrefsEntity entity) { com.abubusoft.kripton.common.Converter<String, String> converter = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL); Builder innerClassBuilder = TypeSpec.classBuilder("BindEditor").addModifiers(Modifier.PUBLIC).addJavadoc("editor class for shared pr...
[ "private", "static", "void", "generateEditor", "(", "PrefsEntity", "entity", ")", "{", "com", ".", "abubusoft", ".", "kripton", ".", "common", ".", "Converter", "<", "String", ",", "String", ">", "converter", "=", "CaseFormat", ".", "LOWER_CAMEL", ".", "conv...
create editor. @param entity the entity
[ "create", "editor", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java#L417-L464
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java
BindSharedPreferencesBuilder.generateInstance
private static void generateInstance(String className) { builder.addField(FieldSpec.builder(className(className), "instance", Modifier.PRIVATE, Modifier.STATIC).addJavadoc("instance of shared preferences\n").build()); // instance MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("getInstance").addModifi...
java
private static void generateInstance(String className) { builder.addField(FieldSpec.builder(className(className), "instance", Modifier.PRIVATE, Modifier.STATIC).addJavadoc("instance of shared preferences\n").build()); // instance MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("getInstance").addModifi...
[ "private", "static", "void", "generateInstance", "(", "String", "className", ")", "{", "builder", ".", "addField", "(", "FieldSpec", ".", "builder", "(", "className", "(", "className", ")", ",", "\"instance\"", ",", "Modifier", ".", "PRIVATE", ",", "Modifier",...
Generate instance of shared preferences. @param className the class name
[ "Generate", "instance", "of", "shared", "preferences", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java#L472-L486
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java
BindSharedPreferencesBuilder.generateRefresh
private static void generateRefresh(String sharedPreferenceName, String className) { MethodSpec.Builder method = MethodSpec.methodBuilder("refresh").addModifiers(Modifier.PUBLIC).addJavadoc("force to refresh values\n").returns(className(className)); method.addStatement("createPrefs()"); method.addStatement("retu...
java
private static void generateRefresh(String sharedPreferenceName, String className) { MethodSpec.Builder method = MethodSpec.methodBuilder("refresh").addModifiers(Modifier.PUBLIC).addJavadoc("force to refresh values\n").returns(className(className)); method.addStatement("createPrefs()"); method.addStatement("retu...
[ "private", "static", "void", "generateRefresh", "(", "String", "sharedPreferenceName", ",", "String", "className", ")", "{", "MethodSpec", ".", "Builder", "method", "=", "MethodSpec", ".", "methodBuilder", "(", "\"refresh\"", ")", ".", "addModifiers", "(", "Modifi...
Generate refresh. @param sharedPreferenceName the shared preference name @param className the class name
[ "Generate", "refresh", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java#L521-L527
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java
BindSharedPreferencesBuilder.generateResetMethod
private static void generateResetMethod(PrefsEntity entity) { // write method MethodSpec.Builder method = MethodSpec.methodBuilder("reset").addModifiers(Modifier.PUBLIC).addJavadoc("reset shared preferences\n").returns(Void.TYPE); if (entity.isImmutablePojo()) { ImmutableUtility.generateImmutableVariableInit(...
java
private static void generateResetMethod(PrefsEntity entity) { // write method MethodSpec.Builder method = MethodSpec.methodBuilder("reset").addModifiers(Modifier.PUBLIC).addJavadoc("reset shared preferences\n").returns(Void.TYPE); if (entity.isImmutablePojo()) { ImmutableUtility.generateImmutableVariableInit(...
[ "private", "static", "void", "generateResetMethod", "(", "PrefsEntity", "entity", ")", "{", "// write method", "MethodSpec", ".", "Builder", "method", "=", "MethodSpec", ".", "methodBuilder", "(", "\"reset\"", ")", ".", "addModifiers", "(", "Modifier", ".", "PUBLI...
Generate reset method. @param entity the entity
[ "Generate", "reset", "method", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java#L535-L548
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java
BindSharedPreferencesBuilder.generateWriteMethod
private static void generateWriteMethod(PrefsEntity entity) { // write method MethodSpec.Builder method = MethodSpec.methodBuilder("write").addJavadoc("write bean entirely\n\n").addJavadoc("@param bean bean to entirely write\n").addModifiers(Modifier.PUBLIC) .addParameter(typeName(entity.getName()), "bean").ret...
java
private static void generateWriteMethod(PrefsEntity entity) { // write method MethodSpec.Builder method = MethodSpec.methodBuilder("write").addJavadoc("write bean entirely\n\n").addJavadoc("@param bean bean to entirely write\n").addModifiers(Modifier.PUBLIC) .addParameter(typeName(entity.getName()), "bean").ret...
[ "private", "static", "void", "generateWriteMethod", "(", "PrefsEntity", "entity", ")", "{", "// write method", "MethodSpec", ".", "Builder", "method", "=", "MethodSpec", ".", "methodBuilder", "(", "\"write\"", ")", ".", "addJavadoc", "(", "\"write bean entirely\\n\\n\...
Generate write method. @param entity the entity
[ "Generate", "write", "method", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java#L556-L576
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java
BindSharedPreferencesBuilder.generateReadMethod
private static void generateReadMethod(PrefsEntity entity) { // read method MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("read").addModifiers(Modifier.PUBLIC).addJavadoc("read bean entirely\n\n").addJavadoc("@return read bean\n") .returns(typeName(entity.getName())); // immutable management ...
java
private static void generateReadMethod(PrefsEntity entity) { // read method MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("read").addModifiers(Modifier.PUBLIC).addJavadoc("read bean entirely\n\n").addJavadoc("@return read bean\n") .returns(typeName(entity.getName())); // immutable management ...
[ "private", "static", "void", "generateReadMethod", "(", "PrefsEntity", "entity", ")", "{", "// read method", "MethodSpec", ".", "Builder", "methodBuilder", "=", "MethodSpec", ".", "methodBuilder", "(", "\"read\"", ")", ".", "addModifiers", "(", "Modifier", ".", "P...
Generate read method. @param entity the entity
[ "Generate", "read", "method", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java#L584-L625
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java
BindSharedPreferencesBuilder.generateSingleReadMethod
private static void generateSingleReadMethod(PrefsEntity entity) { // read method PrefsTransform transform; Converter<String, String> converter = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL); for (PrefsProperty item : entity.getCollection()) { MethodSpec.Builder methodBuilder = MethodSpec.meth...
java
private static void generateSingleReadMethod(PrefsEntity entity) { // read method PrefsTransform transform; Converter<String, String> converter = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL); for (PrefsProperty item : entity.getCollection()) { MethodSpec.Builder methodBuilder = MethodSpec.meth...
[ "private", "static", "void", "generateSingleReadMethod", "(", "PrefsEntity", "entity", ")", "{", "// read method", "PrefsTransform", "transform", ";", "Converter", "<", "String", ",", "String", ">", "converter", "=", "CaseFormat", ".", "LOWER_CAMEL", ".", "converter...
Generate single read method. @param entity the entity
[ "Generate", "single", "read", "method", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/BindSharedPreferencesBuilder.java#L633-L654
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/AbstractMapper.java
AbstractMapper.serialize
protected void serialize(BinderContext context, E object, SerializerWrapper serializerWrapper, boolean writeStartAndEnd) throws Exception { switch (context.getSupportedFormat()) { case XML: try { XmlWrapperSerializer wrapper = ((XmlWrapperSerializer) serializerWrapper); XMLSerializer xmlSerializer=wrapp...
java
protected void serialize(BinderContext context, E object, SerializerWrapper serializerWrapper, boolean writeStartAndEnd) throws Exception { switch (context.getSupportedFormat()) { case XML: try { XmlWrapperSerializer wrapper = ((XmlWrapperSerializer) serializerWrapper); XMLSerializer xmlSerializer=wrapp...
[ "protected", "void", "serialize", "(", "BinderContext", "context", ",", "E", "object", ",", "SerializerWrapper", "serializerWrapper", ",", "boolean", "writeStartAndEnd", ")", "throws", "Exception", "{", "switch", "(", "context", ".", "getSupportedFormat", "(", ")", ...
Serialize an object using the contxt and the serializerWrapper. @param context the context @param object the object @param serializerWrapper the serializer wrapper @param writeStartAndEnd the write start and end @throws Exception the exception
[ "Serialize", "an", "object", "using", "the", "contxt", "and", "the", "serializerWrapper", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/AbstractMapper.java#L111-L139
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asSet
@SuppressWarnings("unchecked") public static <T> Set<T> asSet(Class<T> itemType, T... objects) { LinkedHashSet<T> result = new LinkedHashSet<T>(); for (T item : objects) { result.add(item); } return result; }
java
@SuppressWarnings("unchecked") public static <T> Set<T> asSet(Class<T> itemType, T... objects) { LinkedHashSet<T> result = new LinkedHashSet<T>(); for (T item : objects) { result.add(item); } return result; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Set", "<", "T", ">", "asSet", "(", "Class", "<", "T", ">", "itemType", ",", "T", "...", "objects", ")", "{", "LinkedHashSet", "<", "T", ">", "result", "=", "new",...
create a collection set, with initial values. @param <T> the generic type @param itemType the item type @param objects the objects @return the sets the
[ "create", "a", "collection", "set", "with", "initial", "values", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L42-L51
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asList
public static <E extends List<Boolean>> E asList(boolean[] array, Class<E> listType) { E result; try { result = listType.newInstance(); for (Object item : array) { result.add((boolean) item); } return result; } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); ...
java
public static <E extends List<Boolean>> E asList(boolean[] array, Class<E> listType) { E result; try { result = listType.newInstance(); for (Object item : array) { result.add((boolean) item); } return result; } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); ...
[ "public", "static", "<", "E", "extends", "List", "<", "Boolean", ">", ">", "E", "asList", "(", "boolean", "[", "]", "array", ",", "Class", "<", "E", ">", "listType", ")", "{", "E", "result", ";", "try", "{", "result", "=", "listType", ".", "newInst...
As list. @param <E> the element type @param array the array @param listType the list type @return the e
[ "As", "list", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L282-L296
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asByteTypeArray
public static byte[] asByteTypeArray(List<Byte> input) { byte[] result = new byte[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
java
public static byte[] asByteTypeArray(List<Byte> input) { byte[] result = new byte[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
[ "public", "static", "byte", "[", "]", "asByteTypeArray", "(", "List", "<", "Byte", ">", "input", ")", "{", "byte", "[", "]", "result", "=", "new", "byte", "[", "input", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i"...
As byte type array. @param input the input @return the byte[]
[ "As", "byte", "type", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L464-L472
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asCharacterTypeArray
public static char[] asCharacterTypeArray(List<Character> input) { char[] result = new char[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
java
public static char[] asCharacterTypeArray(List<Character> input) { char[] result = new char[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
[ "public", "static", "char", "[", "]", "asCharacterTypeArray", "(", "List", "<", "Character", ">", "input", ")", "{", "char", "[", "]", "result", "=", "new", "char", "[", "input", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ...
As character type array. @param input the input @return the char[]
[ "As", "character", "type", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L480-L488
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asShortTypeArray
public static short[] asShortTypeArray(List<Short> input) { short[] result = new short[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
java
public static short[] asShortTypeArray(List<Short> input) { short[] result = new short[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
[ "public", "static", "short", "[", "]", "asShortTypeArray", "(", "List", "<", "Short", ">", "input", ")", "{", "short", "[", "]", "result", "=", "new", "short", "[", "input", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", ...
As short type array. @param input the input @return the short[]
[ "As", "short", "type", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L496-L504
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asIntegerTypeArray
public static int[] asIntegerTypeArray(List<Integer> input) { int[] result = new int[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
java
public static int[] asIntegerTypeArray(List<Integer> input) { int[] result = new int[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
[ "public", "static", "int", "[", "]", "asIntegerTypeArray", "(", "List", "<", "Integer", ">", "input", ")", "{", "int", "[", "]", "result", "=", "new", "int", "[", "input", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", ...
As integer type array. @param input the input @return the int[]
[ "As", "integer", "type", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L512-L520
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asLongTypeArray
public static long[] asLongTypeArray(List<Long> input) { long[] result = new long[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
java
public static long[] asLongTypeArray(List<Long> input) { long[] result = new long[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
[ "public", "static", "long", "[", "]", "asLongTypeArray", "(", "List", "<", "Long", ">", "input", ")", "{", "long", "[", "]", "result", "=", "new", "long", "[", "input", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i"...
As long type array. @param input the input @return the long[]
[ "As", "long", "type", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L528-L536
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asFloatTypeArray
public static float[] asFloatTypeArray(List<Float> input) { float[] result = new float[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
java
public static float[] asFloatTypeArray(List<Float> input) { float[] result = new float[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
[ "public", "static", "float", "[", "]", "asFloatTypeArray", "(", "List", "<", "Float", ">", "input", ")", "{", "float", "[", "]", "result", "=", "new", "float", "[", "input", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", ...
As float type array. @param input the input @return the float[]
[ "As", "float", "type", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L544-L552
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asStringArray
public static String[] asStringArray(List<String> input) { String[] result = new String[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
java
public static String[] asStringArray(List<String> input) { String[] result = new String[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
[ "public", "static", "String", "[", "]", "asStringArray", "(", "List", "<", "String", ">", "input", ")", "{", "String", "[", "]", "result", "=", "new", "String", "[", "input", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";",...
As string array. @param input the input @return the string[]
[ "As", "string", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L576-L584
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asBooleanArray
public static Boolean[] asBooleanArray(List<Boolean> input) { Boolean[] result = new Boolean[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
java
public static Boolean[] asBooleanArray(List<Boolean> input) { Boolean[] result = new Boolean[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
[ "public", "static", "Boolean", "[", "]", "asBooleanArray", "(", "List", "<", "Boolean", ">", "input", ")", "{", "Boolean", "[", "]", "result", "=", "new", "Boolean", "[", "input", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ...
As boolean array. @param input the input @return the boolean[]
[ "As", "boolean", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L592-L600
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asArray
public static <E> E[] asArray(List<E> input, E[] newArray) { return input.toArray(newArray); }
java
public static <E> E[] asArray(List<E> input, E[] newArray) { return input.toArray(newArray); }
[ "public", "static", "<", "E", ">", "E", "[", "]", "asArray", "(", "List", "<", "E", ">", "input", ",", "E", "[", "]", "newArray", ")", "{", "return", "input", ".", "toArray", "(", "newArray", ")", ";", "}" ]
As array. @param <E> the element type @param input the input @param newArray the new array @return the e[]
[ "As", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L690-L692
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.asDoubleArray
public static Double[] asDoubleArray(List<Double> input) { Double[] result = new Double[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
java
public static Double[] asDoubleArray(List<Double> input) { Double[] result = new Double[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; }
[ "public", "static", "Double", "[", "]", "asDoubleArray", "(", "List", "<", "Double", ">", "input", ")", "{", "Double", "[", "]", "result", "=", "new", "Double", "[", "input", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";",...
As double array. @param input the input @return the double[]
[ "As", "double", "array", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L716-L724
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java
CollectionUtils.trim
public static void trim(List<String> value) { if (value==null) return; for (int i=0; i<value.size(); i++) { value.set(i, value.get(i).trim()); } }
java
public static void trim(List<String> value) { if (value==null) return; for (int i=0; i<value.size(); i++) { value.set(i, value.get(i).trim()); } }
[ "public", "static", "void", "trim", "(", "List", "<", "String", ">", "value", ")", "{", "if", "(", "value", "==", "null", ")", "return", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "value", ".", "size", "(", ")", ";", "i", "++", ")"...
trim each element of lists. @param value the value
[ "trim", "each", "element", "of", "lists", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CollectionUtils.java#L731-L737
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLReplacerListenerImpl.java
JQLReplacerListenerImpl.resolveFullyQualifiedColumnName
public static String resolveFullyQualifiedColumnName(SQLiteDatabaseSchema schema, SQLiteModelMethod method, String className, String columnName) { Finder<SQLProperty> currentEntity = method.getEntity(); if (StringUtils.hasText(className)) { currentEntity = schema.getEntityBySimpleName(className); AssertKripto...
java
public static String resolveFullyQualifiedColumnName(SQLiteDatabaseSchema schema, SQLiteModelMethod method, String className, String columnName) { Finder<SQLProperty> currentEntity = method.getEntity(); if (StringUtils.hasText(className)) { currentEntity = schema.getEntityBySimpleName(className); AssertKripto...
[ "public", "static", "String", "resolveFullyQualifiedColumnName", "(", "SQLiteDatabaseSchema", "schema", ",", "SQLiteModelMethod", "method", ",", "String", "className", ",", "String", "columnName", ")", "{", "Finder", "<", "SQLProperty", ">", "currentEntity", "=", "met...
given a fully qualified property name, it will be transformed in associated column name. If class or property does not exist, an exception will be thrown @param schema the schema @param method the method @param className the class name @param columnName the property name @return resolved name ex: "person.birth_date"
[ "given", "a", "fully", "qualified", "property", "name", "it", "will", "be", "transformed", "in", "associated", "column", "name", ".", "If", "class", "or", "property", "does", "not", "exist", "an", "exception", "will", "be", "thrown" ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLReplacerListenerImpl.java#L268-L279
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java
SQLiteModelMethod.isLiveData
public static boolean isLiveData(SQLiteModelMethod methodDefinition) { boolean result = false; TypeName returnTypeName = methodDefinition.getReturnClass(); if (returnTypeName instanceof ParameterizedTypeName) { ParameterizedTypeName returnParameterizedTypeName = (ParameterizedTypeName) returnTypeName; Clas...
java
public static boolean isLiveData(SQLiteModelMethod methodDefinition) { boolean result = false; TypeName returnTypeName = methodDefinition.getReturnClass(); if (returnTypeName instanceof ParameterizedTypeName) { ParameterizedTypeName returnParameterizedTypeName = (ParameterizedTypeName) returnTypeName; Clas...
[ "public", "static", "boolean", "isLiveData", "(", "SQLiteModelMethod", "methodDefinition", ")", "{", "boolean", "result", "=", "false", ";", "TypeName", "returnTypeName", "=", "methodDefinition", ".", "getReturnClass", "(", ")", ";", "if", "(", "returnTypeName", "...
Checks if is live data. @param methodDefinition the method definition @return true, if is live data
[ "Checks", "if", "is", "live", "data", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java#L509-L531
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java
SQLiteModelMethod.getJQLDeclared
private String getJQLDeclared() { ModelAnnotation inserAnnotation = this.getAnnotation(BindSqlInsert.class); ModelAnnotation updateAnnotation = this.getAnnotation(BindSqlUpdate.class); ModelAnnotation selectAnnotation = this.getAnnotation(BindSqlSelect.class); ModelAnnotation deleteAnnotation = this.getAnnotati...
java
private String getJQLDeclared() { ModelAnnotation inserAnnotation = this.getAnnotation(BindSqlInsert.class); ModelAnnotation updateAnnotation = this.getAnnotation(BindSqlUpdate.class); ModelAnnotation selectAnnotation = this.getAnnotation(BindSqlSelect.class); ModelAnnotation deleteAnnotation = this.getAnnotati...
[ "private", "String", "getJQLDeclared", "(", ")", "{", "ModelAnnotation", "inserAnnotation", "=", "this", ".", "getAnnotation", "(", "BindSqlInsert", ".", "class", ")", ";", "ModelAnnotation", "updateAnnotation", "=", "this", ".", "getAnnotation", "(", "BindSqlUpdate...
Gets the JQL declared. @return the JQL declared
[ "Gets", "the", "JQL", "declared", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java#L549-L605
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java
SQLiteModelMethod.findStringDynamicStatement
private <A extends Annotation> void findStringDynamicStatement(SQLiteDaoDefinition parent, Class<A> annotationClazz, List<Class<? extends Annotation>> unsupportedQueryType, OnFoundDynamicParameter listener) { int counter = 0; for (VariableElement p : element.getParameters()) { A annotation = p.getAnnotation(...
java
private <A extends Annotation> void findStringDynamicStatement(SQLiteDaoDefinition parent, Class<A> annotationClazz, List<Class<? extends Annotation>> unsupportedQueryType, OnFoundDynamicParameter listener) { int counter = 0; for (VariableElement p : element.getParameters()) { A annotation = p.getAnnotation(...
[ "private", "<", "A", "extends", "Annotation", ">", "void", "findStringDynamicStatement", "(", "SQLiteDaoDefinition", "parent", ",", "Class", "<", "A", ">", "annotationClazz", ",", "List", "<", "Class", "<", "?", "extends", "Annotation", ">", ">", "unsupportedQue...
Look for a method parameter which is annotated with an annotationClass annotation. When it is found, a client action is required through listener. @param <A> the generic type @param parent the parent @param annotationClazz the annotation clazz @param unsupportedQueryType the unsupported query type @param listener the ...
[ "Look", "for", "a", "method", "parameter", "which", "is", "annotated", "with", "an", "annotationClass", "annotation", ".", "When", "it", "is", "found", "a", "client", "action", "is", "required", "through", "listener", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java#L649-L670
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java
SQLiteModelMethod.findParameterAliasByName
public String findParameterAliasByName(String name) { if (parameterName2Alias.containsKey(name)) { return parameterName2Alias.get(name); } return name; }
java
public String findParameterAliasByName(String name) { if (parameterName2Alias.containsKey(name)) { return parameterName2Alias.get(name); } return name; }
[ "public", "String", "findParameterAliasByName", "(", "String", "name", ")", "{", "if", "(", "parameterName2Alias", ".", "containsKey", "(", "name", ")", ")", "{", "return", "parameterName2Alias", ".", "get", "(", "name", ")", ";", "}", "return", "name", ";",...
Retrieve for a method's parameter its alias, used to work with queries. If no alias is present, typeName will be used. @param name the name @return the string
[ "Retrieve", "for", "a", "method", "s", "parameter", "its", "alias", "used", "to", "work", "with", "queries", ".", "If", "no", "alias", "is", "present", "typeName", "will", "be", "used", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java#L719-L725
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java
SQLiteModelMethod.getAdapterForParam
public TypeName getAdapterForParam(String paramName) { if (this.hasAdapterForParam(paramName)) { return TypeUtility.typeName(this.parameterName2Adapter.get(paramName)); } else { return null; } }
java
public TypeName getAdapterForParam(String paramName) { if (this.hasAdapterForParam(paramName)) { return TypeUtility.typeName(this.parameterName2Adapter.get(paramName)); } else { return null; } }
[ "public", "TypeName", "getAdapterForParam", "(", "String", "paramName", ")", "{", "if", "(", "this", ".", "hasAdapterForParam", "(", "paramName", ")", ")", "{", "return", "TypeUtility", ".", "typeName", "(", "this", ".", "parameterName2Adapter", ".", "get", "(...
Gets the adapter for param. @param paramName the param name @return the adapter for param
[ "Gets", "the", "adapter", "for", "param", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java#L906-L912
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java
SQLiteModelMethod.findEntityProperty
public String findEntityProperty() { SQLiteEntity entity = getEntity(); for (Pair<String, TypeName> item : this.parameters) { if (item.value1.equals(TypeUtility.typeName(entity.getElement()))) { return item.value0; } } return null; }
java
public String findEntityProperty() { SQLiteEntity entity = getEntity(); for (Pair<String, TypeName> item : this.parameters) { if (item.value1.equals(TypeUtility.typeName(entity.getElement()))) { return item.value0; } } return null; }
[ "public", "String", "findEntityProperty", "(", ")", "{", "SQLiteEntity", "entity", "=", "getEntity", "(", ")", ";", "for", "(", "Pair", "<", "String", ",", "TypeName", ">", "item", ":", "this", ".", "parameters", ")", "{", "if", "(", "item", ".", "valu...
Find entity property. @return the string
[ "Find", "entity", "property", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java#L919-L928
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java
SQLiteModelMethod.buildPreparedStatementName
public String buildPreparedStatementName() { if (!StringUtils.hasText(preparedStatementName)) { preparedStatementName = getParent().buildPreparedStatementName(getName()); } return preparedStatementName; }
java
public String buildPreparedStatementName() { if (!StringUtils.hasText(preparedStatementName)) { preparedStatementName = getParent().buildPreparedStatementName(getName()); } return preparedStatementName; }
[ "public", "String", "buildPreparedStatementName", "(", ")", "{", "if", "(", "!", "StringUtils", ".", "hasText", "(", "preparedStatementName", ")", ")", "{", "preparedStatementName", "=", "getParent", "(", ")", ".", "buildPreparedStatementName", "(", "getName", "("...
Builds the prepared statement name. @return the string
[ "Builds", "the", "prepared", "statement", "name", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java#L938-L943
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java
StringUtils.checkSize
public static String checkSize(Object value, int limitSize, String defaultValue) { if (value != null) { if (byte[].class.getSimpleName().equals(value.getClass().getSimpleName())) { return checkSize((byte[]) value, limitSize/2); } String str = value.toString(); if (str.length() > limitSize) { retu...
java
public static String checkSize(Object value, int limitSize, String defaultValue) { if (value != null) { if (byte[].class.getSimpleName().equals(value.getClass().getSimpleName())) { return checkSize((byte[]) value, limitSize/2); } String str = value.toString(); if (str.length() > limitSize) { retu...
[ "public", "static", "String", "checkSize", "(", "Object", "value", ",", "int", "limitSize", ",", "String", "defaultValue", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "if", "(", "byte", "[", "]", ".", "class", ".", "getSimpleName", "(", ")", ...
limit string size. @param value the value @param limitSize the limit size @param defaultValue the default value @return the string
[ "limit", "string", "size", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L76-L90
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java
StringUtils.bytesToHex
public static String bytesToHex(byte[] bytes, int size) { size=Math.min(bytes.length, size); char[] hexChars = new char[size * 2]; for ( int j = 0; j < size; j++ ) { int v = bytes[j] & 0xFF; hexChars[j * 2] = hexArray[v >>> 4]; hexChars[j * 2 + 1] = hexArray[v & 0x0F]; } ...
java
public static String bytesToHex(byte[] bytes, int size) { size=Math.min(bytes.length, size); char[] hexChars = new char[size * 2]; for ( int j = 0; j < size; j++ ) { int v = bytes[j] & 0xFF; hexChars[j * 2] = hexArray[v >>> 4]; hexChars[j * 2 + 1] = hexArray[v & 0x0F]; } ...
[ "public", "static", "String", "bytesToHex", "(", "byte", "[", "]", "bytes", ",", "int", "size", ")", "{", "size", "=", "Math", ".", "min", "(", "bytes", ".", "length", ",", "size", ")", ";", "char", "[", "]", "hexChars", "=", "new", "char", "[", ...
Bytes to hex. @param bytes the bytes @param size the size @return the string
[ "Bytes", "to", "hex", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L102-L111
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java
StringUtils.checkSize
public static String checkSize(byte[] value, int limitSize) { if (value != null) { if (value.length > limitSize) { return bytesToHex(value, limitSize-3) + "..."; } else return bytesToHex(value, value.length); } else return null; }
java
public static String checkSize(byte[] value, int limitSize) { if (value != null) { if (value.length > limitSize) { return bytesToHex(value, limitSize-3) + "..."; } else return bytesToHex(value, value.length); } else return null; }
[ "public", "static", "String", "checkSize", "(", "byte", "[", "]", "value", ",", "int", "limitSize", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "if", "(", "value", ".", "length", ">", "limitSize", ")", "{", "return", "bytesToHex", "(", "val...
Check size. @param value the value @param limitSize the limit size @return the string
[ "Check", "size", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L120-L129
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java
StringUtils.formatParam
public static String formatParam(Object value, String delimiter) { if (value != null) { if (byte[].class.getSimpleName().equals(value.getClass().getSimpleName())) { return checkSize((byte[]) value, VIEW_SIZE); } String str = value.toString(); if (str.length() > VIEW_SIZE) { return delimiter + str...
java
public static String formatParam(Object value, String delimiter) { if (value != null) { if (byte[].class.getSimpleName().equals(value.getClass().getSimpleName())) { return checkSize((byte[]) value, VIEW_SIZE); } String str = value.toString(); if (str.length() > VIEW_SIZE) { return delimiter + str...
[ "public", "static", "String", "formatParam", "(", "Object", "value", ",", "String", "delimiter", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "if", "(", "byte", "[", "]", ".", "class", ".", "getSimpleName", "(", ")", ".", "equals", "(", "val...
format as sql parameter. If value is not null, method will return 'value'. If value is not null, delimiter will be used to delimit return value. Otherwise, defaultValue will be returned, without delimiter. @param value the value @param delimiter the delimiter @return the string
[ "format", "as", "sql", "parameter", ".", "If", "value", "is", "not", "null", "method", "will", "return", "value", ".", "If", "value", "is", "not", "null", "delimiter", "will", "be", "used", "to", "delimit", "return", "value", ".", "Otherwise", "defaultValu...
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L140-L154
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java
StringUtils.checkSize
public static String checkSize(Object value, String defaultValue) { return checkSize(value, VIEW_SIZE, defaultValue); }
java
public static String checkSize(Object value, String defaultValue) { return checkSize(value, VIEW_SIZE, defaultValue); }
[ "public", "static", "String", "checkSize", "(", "Object", "value", ",", "String", "defaultValue", ")", "{", "return", "checkSize", "(", "value", ",", "VIEW_SIZE", ",", "defaultValue", ")", ";", "}" ]
limit string size to 32. @param value the value @param defaultValue the default value @return the string
[ "limit", "string", "size", "to", "32", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L173-L175
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java
StringUtils.lowercaseFirstLetter
public static String lowercaseFirstLetter(String value) { // se non abbiamo input, allora non facciamo niente if (value == null || value.length() == 0) return ""; char[] stringArray = value.toCharArray(); stringArray[0] = Character.toLowerCase(stringArray[0]); return new String(stringArray); }
java
public static String lowercaseFirstLetter(String value) { // se non abbiamo input, allora non facciamo niente if (value == null || value.length() == 0) return ""; char[] stringArray = value.toCharArray(); stringArray[0] = Character.toLowerCase(stringArray[0]); return new String(stringArray); }
[ "public", "static", "String", "lowercaseFirstLetter", "(", "String", "value", ")", "{", "// se non abbiamo input, allora non facciamo niente", "if", "(", "value", "==", "null", "||", "value", ".", "length", "(", ")", "==", "0", ")", "return", "\"\"", ";", "char"...
Lowercase first letter. @param value the value @return the string
[ "Lowercase", "first", "letter", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L193-L202
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java
StringUtils.string2Writer
public static void string2Writer(String source, Writer out) throws IOException { char[] buffer = source.toCharArray(); for (int i = 0; i < buffer.length; i++) { out.append(buffer[i]); } out.flush(); }
java
public static void string2Writer(String source, Writer out) throws IOException { char[] buffer = source.toCharArray(); for (int i = 0; i < buffer.length; i++) { out.append(buffer[i]); } out.flush(); }
[ "public", "static", "void", "string2Writer", "(", "String", "source", ",", "Writer", "out", ")", "throws", "IOException", "{", "char", "[", "]", "buffer", "=", "source", ".", "toCharArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "...
String 2 writer. @param source the source @param out the out @throws IOException Signals that an I/O exception has occurred.
[ "String", "2", "writer", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L211-L218
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java
StringUtils.reader2String
public static String reader2String(Reader source) throws IOException { char[] cbuf = new char[65535]; StringBuffer stringbuf = new StringBuffer(); int count = 0; while ((count = source.read(cbuf, 0, 65535)) != -1) { stringbuf.append(cbuf, 0, count); } return stringbuf.toString(); }
java
public static String reader2String(Reader source) throws IOException { char[] cbuf = new char[65535]; StringBuffer stringbuf = new StringBuffer(); int count = 0; while ((count = source.read(cbuf, 0, 65535)) != -1) { stringbuf.append(cbuf, 0, count); } return stringbuf.toString(); }
[ "public", "static", "String", "reader2String", "(", "Reader", "source", ")", "throws", "IOException", "{", "char", "[", "]", "cbuf", "=", "new", "char", "[", "65535", "]", ";", "StringBuffer", "stringbuf", "=", "new", "StringBuffer", "(", ")", ";", "int", ...
Reader 2 string. @param source the source @return the string @throws IOException Signals that an I/O exception has occurred.
[ "Reader", "2", "string", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L227-L237
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBufferHelper.java
DynamicByteBufferHelper.addDouble
public static byte[] addDouble(byte[] array, double value) { byte[] holder = new byte[4]; doubleTo(holder, 0, value); return add(array, holder); }
java
public static byte[] addDouble(byte[] array, double value) { byte[] holder = new byte[4]; doubleTo(holder, 0, value); return add(array, holder); }
[ "public", "static", "byte", "[", "]", "addDouble", "(", "byte", "[", "]", "array", ",", "double", "value", ")", "{", "byte", "[", "]", "holder", "=", "new", "byte", "[", "4", "]", ";", "doubleTo", "(", "holder", ",", "0", ",", "value", ")", ";", ...
Adds the double. @param array the array @param value the value @return the byte[]
[ "Adds", "the", "double", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBufferHelper.java#L912-L917
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBufferHelper.java
DynamicByteBufferHelper.insertDoubleInto
public static byte[] insertDoubleInto(byte[] array, int index, double value) { byte[] holder = new byte[4]; doubleTo(holder, 0, value); return insert(array, index, holder); }
java
public static byte[] insertDoubleInto(byte[] array, int index, double value) { byte[] holder = new byte[4]; doubleTo(holder, 0, value); return insert(array, index, holder); }
[ "public", "static", "byte", "[", "]", "insertDoubleInto", "(", "byte", "[", "]", "array", ",", "int", "index", ",", "double", "value", ")", "{", "byte", "[", "]", "holder", "=", "new", "byte", "[", "4", "]", ";", "doubleTo", "(", "holder", ",", "0"...
Insert double into. @param array the array @param index the index @param value the value @return the byte[]
[ "Insert", "double", "into", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBufferHelper.java#L927-L932
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBufferHelper.java
DynamicByteBufferHelper.equalsOrDie
public static boolean equalsOrDie(byte[] expected, byte[] got) { if (expected.length != got.length) { throw new KriptonRuntimeException("Lengths did not match, expected length" + expected.length + "but got" + got.length); } for (int index = 0; index < expected.length; index++) { if (expected[index] != got...
java
public static boolean equalsOrDie(byte[] expected, byte[] got) { if (expected.length != got.length) { throw new KriptonRuntimeException("Lengths did not match, expected length" + expected.length + "but got" + got.length); } for (int index = 0; index < expected.length; index++) { if (expected[index] != got...
[ "public", "static", "boolean", "equalsOrDie", "(", "byte", "[", "]", "expected", ",", "byte", "[", "]", "got", ")", "{", "if", "(", "expected", ".", "length", "!=", "got", ".", "length", ")", "{", "throw", "new", "KriptonRuntimeException", "(", "\"Length...
Checks to see if two arrays are equals. @param expected expected array @param got got array @return true if equal or throws exception if not.
[ "Checks", "to", "see", "if", "two", "arrays", "are", "equals", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBufferHelper.java#L1189-L1202
train
xcesco/kripton
kripton-arch-integration/src/main/java/android/arch/lifecycle/LiveData.java
LiveData.considerNotify
private void considerNotify(ObserverWrapper observer) { if (!observer.mActive) { return; } // Check latest state b4 dispatch. Maybe it changed state but we didn't get the event yet. // // we still first check observer.active to keep it as the entrance for events. So e...
java
private void considerNotify(ObserverWrapper observer) { if (!observer.mActive) { return; } // Check latest state b4 dispatch. Maybe it changed state but we didn't get the event yet. // // we still first check observer.active to keep it as the entrance for events. So e...
[ "private", "void", "considerNotify", "(", "ObserverWrapper", "observer", ")", "{", "if", "(", "!", "observer", ".", "mActive", ")", "{", "return", ";", "}", "// Check latest state b4 dispatch. Maybe it changed state but we didn't get the event yet.", "//", "// we still firs...
Consider notify. @param observer the observer
[ "Consider", "notify", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/lifecycle/LiveData.java#L114-L133
train
xcesco/kripton
kripton-arch-integration/src/main/java/android/arch/lifecycle/LiveData.java
LiveData.removeObserver
@MainThread public void removeObserver(@NonNull final Observer<T> observer) { assertMainThread("removeObserver"); ObserverWrapper removed = mObservers.remove(observer); if (removed == null) { return; } removed.detachObserver(); removed.activeStateChanged(f...
java
@MainThread public void removeObserver(@NonNull final Observer<T> observer) { assertMainThread("removeObserver"); ObserverWrapper removed = mObservers.remove(observer); if (removed == null) { return; } removed.detachObserver(); removed.activeStateChanged(f...
[ "@", "MainThread", "public", "void", "removeObserver", "(", "@", "NonNull", "final", "Observer", "<", "T", ">", "observer", ")", "{", "assertMainThread", "(", "\"removeObserver\"", ")", ";", "ObserverWrapper", "removed", "=", "mObservers", ".", "remove", "(", ...
Removes the given observer from the observers list. @param observer The Observer to receive events.
[ "Removes", "the", "given", "observer", "from", "the", "observers", "list", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/lifecycle/LiveData.java#L243-L252
train
xcesco/kripton
kripton-arch-integration/src/main/java/android/arch/lifecycle/LiveData.java
LiveData.getValue
@Nullable public T getValue() { Object data = mData; if (data != NOT_SET) { //noinspection unchecked return (T) data; } return null; }
java
@Nullable public T getValue() { Object data = mData; if (data != NOT_SET) { //noinspection unchecked return (T) data; } return null; }
[ "@", "Nullable", "public", "T", "getValue", "(", ")", "{", "Object", "data", "=", "mData", ";", "if", "(", "data", "!=", "NOT_SET", ")", "{", "//noinspection unchecked", "return", "(", "T", ")", "data", ";", "}", "return", "null", ";", "}" ]
Returns the current value. Note that calling this method on a background thread does not guarantee that the latest value set will be received. @return the current value
[ "Returns", "the", "current", "value", ".", "Note", "that", "calling", "this", "method", "on", "a", "background", "thread", "does", "not", "guarantee", "that", "the", "latest", "value", "set", "will", "be", "received", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/lifecycle/LiveData.java#L320-L328
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteEntity.java
SQLiteEntity.getPrimaryKey
public SQLProperty getPrimaryKey() { for (SQLProperty item : collection) { if (item.isPrimaryKey()) { return item; } } // try to get id SQLProperty id = findPropertyByName("id"); return id; }
java
public SQLProperty getPrimaryKey() { for (SQLProperty item : collection) { if (item.isPrimaryKey()) { return item; } } // try to get id SQLProperty id = findPropertyByName("id"); return id; }
[ "public", "SQLProperty", "getPrimaryKey", "(", ")", "{", "for", "(", "SQLProperty", "item", ":", "collection", ")", "{", "if", "(", "item", ".", "isPrimaryKey", "(", ")", ")", "{", "return", "item", ";", "}", "}", "// try to get id", "SQLProperty", "id", ...
True if there is a primary key. @return true if there is a primary key
[ "True", "if", "there", "is", "a", "primary", "key", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteEntity.java#L104-L115
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteEntity.java
SQLiteEntity.buildTableName
private String buildTableName(Elements elementUtils, SQLiteDatabaseSchema schema) { tableName = getSimpleName(); tableName = schema.classNameConverter.convert(tableName); String temp = AnnotationUtility.extractAsString(getElement(), BindSqlType.class, AnnotationAttributeType.NAME); if (StringUtils.hasText(temp...
java
private String buildTableName(Elements elementUtils, SQLiteDatabaseSchema schema) { tableName = getSimpleName(); tableName = schema.classNameConverter.convert(tableName); String temp = AnnotationUtility.extractAsString(getElement(), BindSqlType.class, AnnotationAttributeType.NAME); if (StringUtils.hasText(temp...
[ "private", "String", "buildTableName", "(", "Elements", "elementUtils", ",", "SQLiteDatabaseSchema", "schema", ")", "{", "tableName", "=", "getSimpleName", "(", ")", ";", "tableName", "=", "schema", ".", "classNameConverter", ".", "convert", "(", "tableName", ")",...
Builds the table name. @param elementUtils the element utils @param schema the schema @return the string
[ "Builds", "the", "table", "name", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteEntity.java#L136-L147
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteEntity.java
SQLiteEntity.findRelationByParentProperty
public Touple<SQLProperty, String, SQLiteEntity, SQLRelationType> findRelationByParentProperty( String parentFieldName) { for (Touple<SQLProperty, String, SQLiteEntity, SQLRelationType> item : relations) { if (item.value0.getName().equals(parentFieldName)) { return item; } } return null; }
java
public Touple<SQLProperty, String, SQLiteEntity, SQLRelationType> findRelationByParentProperty( String parentFieldName) { for (Touple<SQLProperty, String, SQLiteEntity, SQLRelationType> item : relations) { if (item.value0.getName().equals(parentFieldName)) { return item; } } return null; }
[ "public", "Touple", "<", "SQLProperty", ",", "String", ",", "SQLiteEntity", ",", "SQLRelationType", ">", "findRelationByParentProperty", "(", "String", "parentFieldName", ")", "{", "for", "(", "Touple", "<", "SQLProperty", ",", "String", ",", "SQLiteEntity", ",", ...
find a relation specifing parent field name, that is the name of the relation @param parentFieldName @return
[ "find", "a", "relation", "specifing", "parent", "field", "name", "that", "is", "the", "name", "of", "the", "relation" ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteEntity.java#L156-L165
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java
ModifyRawHelper.extractWhereConditions
static String extractWhereConditions(boolean updateMode, SQLiteModelMethod method) { final One<String> whereCondition = new One<String>(""); final One<Boolean> found = new One<Boolean>(null); JQLChecker.getInstance().replaceVariableStatements(method, method.jql.value, new JQLReplaceVariableStatementListenerImpl()...
java
static String extractWhereConditions(boolean updateMode, SQLiteModelMethod method) { final One<String> whereCondition = new One<String>(""); final One<Boolean> found = new One<Boolean>(null); JQLChecker.getInstance().replaceVariableStatements(method, method.jql.value, new JQLReplaceVariableStatementListenerImpl()...
[ "static", "String", "extractWhereConditions", "(", "boolean", "updateMode", ",", "SQLiteModelMethod", "method", ")", "{", "final", "One", "<", "String", ">", "whereCondition", "=", "new", "One", "<", "String", ">", "(", "\"\"", ")", ";", "final", "One", "<",...
Extract where conditions. @param updateMode the update mode @param method the method @return the string
[ "Extract", "where", "conditions", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java#L388-L405
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java
ModifyRawHelper.isIn
static boolean isIn(TypeName value, Class<?>... classes) { for (Class<?> item : classes) { if (value.toString().equals(TypeName.get(item).toString())) { return true; } } return false; }
java
static boolean isIn(TypeName value, Class<?>... classes) { for (Class<?> item : classes) { if (value.toString().equals(TypeName.get(item).toString())) { return true; } } return false; }
[ "static", "boolean", "isIn", "(", "TypeName", "value", ",", "Class", "<", "?", ">", "...", "classes", ")", "{", "for", "(", "Class", "<", "?", ">", "item", ":", "classes", ")", "{", "if", "(", "value", ".", "toString", "(", ")", ".", "equals", "(...
Checks if is in. @param value the value @param classes the classes @return true, if is in
[ "Checks", "if", "is", "in", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java#L631-L639
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/map/BindMapHelper.java
BindMapHelper.parseMap
public static Map<String, Object> parseMap(AbstractContext context, ParserWrapper parserWrapper, Map<String, Object> map) { switch (context.getSupportedFormat()) { case XML: throw (new KriptonRuntimeException(context.getSupportedFormat() + " context does not support parse direct map parsing")); default: Jac...
java
public static Map<String, Object> parseMap(AbstractContext context, ParserWrapper parserWrapper, Map<String, Object> map) { switch (context.getSupportedFormat()) { case XML: throw (new KriptonRuntimeException(context.getSupportedFormat() + " context does not support parse direct map parsing")); default: Jac...
[ "public", "static", "Map", "<", "String", ",", "Object", ">", "parseMap", "(", "AbstractContext", "context", ",", "ParserWrapper", "parserWrapper", ",", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "switch", "(", "context", ".", "getSupportedFo...
Parse a map. @param context the context @param parserWrapper the parser wrapper @param map the map @return map
[ "Parse", "a", "map", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/map/BindMapHelper.java#L47-L58
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/map/BindMapHelper.java
BindMapHelper.parseMap
static Map<String, Object> parseMap(AbstractContext context, JsonParser parser, Map<String, Object> map, boolean skipRead) { try { String key; Object value; if (!skipRead) { parser.nextToken(); } if (parser.currentToken() != JsonToken.START_OBJECT) { throw (new KriptonRuntimeException("Invali...
java
static Map<String, Object> parseMap(AbstractContext context, JsonParser parser, Map<String, Object> map, boolean skipRead) { try { String key; Object value; if (!skipRead) { parser.nextToken(); } if (parser.currentToken() != JsonToken.START_OBJECT) { throw (new KriptonRuntimeException("Invali...
[ "static", "Map", "<", "String", ",", "Object", ">", "parseMap", "(", "AbstractContext", "context", ",", "JsonParser", "parser", ",", "Map", "<", "String", ",", "Object", ">", "map", ",", "boolean", "skipRead", ")", "{", "try", "{", "String", "key", ";", ...
Parse map. @param context the context @param parser the parser @param map the map @param skipRead the skip read @return the map
[ "Parse", "map", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/map/BindMapHelper.java#L69-L115
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/map/BindMapHelper.java
BindMapHelper.parseList
static List<Object> parseList(AbstractContext context, JsonParser parser, List<Object> list, boolean skipRead) { try { if (!skipRead) { parser.nextToken(); } if (parser.currentToken() != JsonToken.START_ARRAY) { throw (new KriptonRuntimeException("Invalid input format")); } skipRead = false; ...
java
static List<Object> parseList(AbstractContext context, JsonParser parser, List<Object> list, boolean skipRead) { try { if (!skipRead) { parser.nextToken(); } if (parser.currentToken() != JsonToken.START_ARRAY) { throw (new KriptonRuntimeException("Invalid input format")); } skipRead = false; ...
[ "static", "List", "<", "Object", ">", "parseList", "(", "AbstractContext", "context", ",", "JsonParser", "parser", ",", "List", "<", "Object", ">", "list", ",", "boolean", "skipRead", ")", "{", "try", "{", "if", "(", "!", "skipRead", ")", "{", "parser", ...
Parse a list. @param context the context @param parser the parser @param list the list @param skipRead the skip read @return the list
[ "Parse", "a", "list", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/map/BindMapHelper.java#L126-L173
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/KriptonBinder.java
KriptonBinder.bind
public static BinderContext bind(BinderType format) { BinderContext binder = binders.get(format); if (binder == null) throw new KriptonRuntimeException(String.format("%s format is not supported", format)); return binder; }
java
public static BinderContext bind(BinderType format) { BinderContext binder = binders.get(format); if (binder == null) throw new KriptonRuntimeException(String.format("%s format is not supported", format)); return binder; }
[ "public", "static", "BinderContext", "bind", "(", "BinderType", "format", ")", "{", "BinderContext", "binder", "=", "binders", ".", "get", "(", "format", ")", ";", "if", "(", "binder", "==", "null", ")", "throw", "new", "KriptonRuntimeException", "(", "Strin...
retrieve binding context for specified data format. @param format data format used to persist data @return binding context
[ "retrieve", "binding", "context", "for", "specified", "data", "format", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/KriptonBinder.java#L93-L100
train
xcesco/kripton
kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/commons/IOUtils.java
IOUtils.readText
public static String readText(InputStream inputStream) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line; StringBuilder stringBuilder = new StringBuilder(); try { while ((line = bufferedReader.readLine()) != null) { stringBuilder.append(line); strin...
java
public static String readText(InputStream inputStream) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line; StringBuilder stringBuilder = new StringBuilder(); try { while ((line = bufferedReader.readLine()) != null) { stringBuilder.append(line); strin...
[ "public", "static", "String", "readText", "(", "InputStream", "inputStream", ")", "{", "BufferedReader", "bufferedReader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "inputStream", ")", ")", ";", "String", "line", ";", "StringBuilder", "st...
Read text. @param inputStream the input stream @return the string
[ "Read", "text", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/commons/IOUtils.java#L94-L120
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/MapBindTransformation.java
MapBindTransformation.defineMapClass
private Class<?> defineMapClass(ParameterizedTypeName mapTypeName) { if (mapTypeName.rawType.toString().startsWith(Map.class.getCanonicalName())) { // it's a list return HashMap.class; } else if (mapTypeName.rawType.toString().startsWith(SortedMap.class.getCanonicalName())) { return TreeMap.class; } tr...
java
private Class<?> defineMapClass(ParameterizedTypeName mapTypeName) { if (mapTypeName.rawType.toString().startsWith(Map.class.getCanonicalName())) { // it's a list return HashMap.class; } else if (mapTypeName.rawType.toString().startsWith(SortedMap.class.getCanonicalName())) { return TreeMap.class; } tr...
[ "private", "Class", "<", "?", ">", "defineMapClass", "(", "ParameterizedTypeName", "mapTypeName", ")", "{", "if", "(", "mapTypeName", ".", "rawType", ".", "toString", "(", ")", ".", "startsWith", "(", "Map", ".", "class", ".", "getCanonicalName", "(", ")", ...
Define map class. @param mapTypeName the map type name @return the class
[ "Define", "map", "class", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/MapBindTransformation.java#L68-L81
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java
SQLiteDatabaseSchema.fillClazz
private String fillClazz(String configClazz, String clazz) { if (!clazz.equals(configClazz)) { return configClazz; } else { return null; } }
java
private String fillClazz(String configClazz, String clazz) { if (!clazz.equals(configClazz)) { return configClazz; } else { return null; } }
[ "private", "String", "fillClazz", "(", "String", "configClazz", ",", "String", "clazz", ")", "{", "if", "(", "!", "clazz", ".", "equals", "(", "configClazz", ")", ")", "{", "return", "configClazz", ";", "}", "else", "{", "return", "null", ";", "}", "}"...
Fill clazz. @param configClazz the config clazz @param clazz the clazz @return the string
[ "Fill", "clazz", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java#L337-L343
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java
SQLiteDatabaseSchema.addEntity
public void addEntity(SQLiteEntity value) { entities.put(value.getName(), value); entitiesBySimpleName.put(value.getSimpleName().toString().toLowerCase(), value); Set<SQLProperty> listEntity = null; // update map property name -> property collection with same name for (SQLProperty p : value.getCollection()) ...
java
public void addEntity(SQLiteEntity value) { entities.put(value.getName(), value); entitiesBySimpleName.put(value.getSimpleName().toString().toLowerCase(), value); Set<SQLProperty> listEntity = null; // update map property name -> property collection with same name for (SQLProperty p : value.getCollection()) ...
[ "public", "void", "addEntity", "(", "SQLiteEntity", "value", ")", "{", "entities", ".", "put", "(", "value", ".", "getName", "(", ")", ",", "value", ")", ";", "entitiesBySimpleName", ".", "put", "(", "value", ".", "getSimpleName", "(", ")", ".", "toStrin...
Adds the entity. @param value the value
[ "Adds", "the", "entity", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java#L359-L374
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java
SQLiteDatabaseSchema.checkName
private void checkName(Set<SQLProperty> listEntity, SQLProperty p) { for (SQLProperty item : listEntity) { AssertKripton.assertTrueOrInvalidPropertyName(item.columnName.equals(p.columnName), item, p); } }
java
private void checkName(Set<SQLProperty> listEntity, SQLProperty p) { for (SQLProperty item : listEntity) { AssertKripton.assertTrueOrInvalidPropertyName(item.columnName.equals(p.columnName), item, p); } }
[ "private", "void", "checkName", "(", "Set", "<", "SQLProperty", ">", "listEntity", ",", "SQLProperty", "p", ")", "{", "for", "(", "SQLProperty", "item", ":", "listEntity", ")", "{", "AssertKripton", ".", "assertTrueOrInvalidPropertyName", "(", "item", ".", "co...
property in different class, but same name, must have same column name. @param listEntity the list entity @param p the p
[ "property", "in", "different", "class", "but", "same", "name", "must", "have", "same", "column", "name", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java#L384-L389
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java
SQLiteDatabaseSchema.getEntityBySimpleName
public Finder<SQLProperty> getEntityBySimpleName(String entityName) { if (entityName == null) return null; SQLiteEntity result = entitiesBySimpleName.get(entityName.toLowerCase()); if (result != null) return result; for (GeneratedTypeElement item : this.generatedEntities) { if (item.typeSpec.name.toL...
java
public Finder<SQLProperty> getEntityBySimpleName(String entityName) { if (entityName == null) return null; SQLiteEntity result = entitiesBySimpleName.get(entityName.toLowerCase()); if (result != null) return result; for (GeneratedTypeElement item : this.generatedEntities) { if (item.typeSpec.name.toL...
[ "public", "Finder", "<", "SQLProperty", ">", "getEntityBySimpleName", "(", "String", "entityName", ")", "{", "if", "(", "entityName", "==", "null", ")", "return", "null", ";", "SQLiteEntity", "result", "=", "entitiesBySimpleName", ".", "get", "(", "entityName", ...
Gets the entity by simple name. @param entityName the entity name @return the entity by simple name
[ "Gets", "the", "entity", "by", "simple", "name", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java#L427-L442
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java
SQLiteDatabaseSchema.getPropertyBySimpleName
public Set<SQLProperty> getPropertyBySimpleName(String propertyName) { if (propertyName == null) return null; return this.propertyBySimpleName.get(propertyName.toLowerCase()); }
java
public Set<SQLProperty> getPropertyBySimpleName(String propertyName) { if (propertyName == null) return null; return this.propertyBySimpleName.get(propertyName.toLowerCase()); }
[ "public", "Set", "<", "SQLProperty", ">", "getPropertyBySimpleName", "(", "String", "propertyName", ")", "{", "if", "(", "propertyName", "==", "null", ")", "return", "null", ";", "return", "this", ".", "propertyBySimpleName", ".", "get", "(", "propertyName", "...
Gets the property by simple name. @param propertyName the property name @return the property by simple name
[ "Gets", "the", "property", "by", "simple", "name", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java#L451-L456
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java
SQLiteDatabaseSchema.findColumnNameByPropertyName
public String findColumnNameByPropertyName(SQLiteModelMethod method, String propertyName) { Set<SQLProperty> propertiesSet = getPropertyBySimpleName(propertyName); Set<String> set = new HashSet<String>(); String result = null; for (SQLProperty item : propertiesSet) { result = item.columnName; set.add(ite...
java
public String findColumnNameByPropertyName(SQLiteModelMethod method, String propertyName) { Set<SQLProperty> propertiesSet = getPropertyBySimpleName(propertyName); Set<String> set = new HashSet<String>(); String result = null; for (SQLProperty item : propertiesSet) { result = item.columnName; set.add(ite...
[ "public", "String", "findColumnNameByPropertyName", "(", "SQLiteModelMethod", "method", ",", "String", "propertyName", ")", "{", "Set", "<", "SQLProperty", ">", "propertiesSet", "=", "getPropertyBySimpleName", "(", "propertyName", ")", ";", "Set", "<", "String", ">"...
get a. @param method the method @param propertyName the property name @return the string
[ "get", "a", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java#L467-L481
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java
SQLiteDatabaseSchema.getGeneratedClass
public ClassName getGeneratedClass() { String packageName = getElement().asType().toString(); return TypeUtility .className(packageName.substring(0, packageName.lastIndexOf(".")) + "." + getGeneratedClassName()); }
java
public ClassName getGeneratedClass() { String packageName = getElement().asType().toString(); return TypeUtility .className(packageName.substring(0, packageName.lastIndexOf(".")) + "." + getGeneratedClassName()); }
[ "public", "ClassName", "getGeneratedClass", "(", ")", "{", "String", "packageName", "=", "getElement", "(", ")", ".", "asType", "(", ")", ".", "toString", "(", ")", ";", "return", "TypeUtility", ".", "className", "(", "packageName", ".", "substring", "(", ...
Gets the generated class. @return the generated class
[ "Gets", "the", "generated", "class", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDatabaseSchema.java#L510-L514
train
xcesco/kripton
kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java
SQLiteUpdateTaskHelper.renameTablesWithPrefix
public static void renameTablesWithPrefix(SQLiteDatabase db, final String prefix) { Logger.info("MASSIVE TABLE RENAME OPERATION: ADD PREFIX " + prefix); query(db, null, QueryType.TABLE, new OnResultListener() { @Override public void onRow(SQLiteDatabase db, String name, String sql) { sql = String.format(...
java
public static void renameTablesWithPrefix(SQLiteDatabase db, final String prefix) { Logger.info("MASSIVE TABLE RENAME OPERATION: ADD PREFIX " + prefix); query(db, null, QueryType.TABLE, new OnResultListener() { @Override public void onRow(SQLiteDatabase db, String name, String sql) { sql = String.format(...
[ "public", "static", "void", "renameTablesWithPrefix", "(", "SQLiteDatabase", "db", ",", "final", "String", "prefix", ")", "{", "Logger", ".", "info", "(", "\"MASSIVE TABLE RENAME OPERATION: ADD PREFIX \"", "+", "prefix", ")", ";", "query", "(", "db", ",", "null", ...
Add to all table a specifix prefix. @param db the db @param prefix the prefix
[ "Add", "to", "all", "table", "a", "specifix", "prefix", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java#L161-L173
train
xcesco/kripton
kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java
SQLiteUpdateTaskHelper.dropTablesWithPrefix
public static void dropTablesWithPrefix(SQLiteDatabase db, String prefix) { Logger.info("MASSIVE TABLE DROP OPERATION%s", StringUtils.ifNotEmptyAppend(prefix, " WITH PREFIX ")); drop(db, QueryType.TABLE, prefix); }
java
public static void dropTablesWithPrefix(SQLiteDatabase db, String prefix) { Logger.info("MASSIVE TABLE DROP OPERATION%s", StringUtils.ifNotEmptyAppend(prefix, " WITH PREFIX ")); drop(db, QueryType.TABLE, prefix); }
[ "public", "static", "void", "dropTablesWithPrefix", "(", "SQLiteDatabase", "db", ",", "String", "prefix", ")", "{", "Logger", ".", "info", "(", "\"MASSIVE TABLE DROP OPERATION%s\"", ",", "StringUtils", ".", "ifNotEmptyAppend", "(", "prefix", ",", "\" WITH PREFIX \"", ...
Drop all table with specific prefix. @param db the db @param prefix the prefix
[ "Drop", "all", "table", "with", "specific", "prefix", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java#L183-L186
train
xcesco/kripton
kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java
SQLiteUpdateTaskHelper.dropTablesAndIndices
public static void dropTablesAndIndices(SQLiteDatabase db) { drop(db, QueryType.INDEX, null); drop(db, QueryType.TABLE, null); }
java
public static void dropTablesAndIndices(SQLiteDatabase db) { drop(db, QueryType.INDEX, null); drop(db, QueryType.TABLE, null); }
[ "public", "static", "void", "dropTablesAndIndices", "(", "SQLiteDatabase", "db", ")", "{", "drop", "(", "db", ",", "QueryType", ".", "INDEX", ",", "null", ")", ";", "drop", "(", "db", ",", "QueryType", ".", "TABLE", ",", "null", ")", ";", "}" ]
Drop tables and indices. @param db the db
[ "Drop", "tables", "and", "indices", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java#L194-L197
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/TypeAdapterHelper.java
TypeAdapterHelper.detectSourceType
public static String detectSourceType(Element element, String adapterClazz) { TypeElement a = BaseProcessor.elementUtils.getTypeElement(adapterClazz); for (Element i : BaseProcessor.elementUtils.getAllMembers(a)) { if (i.getKind() == ElementKind.METHOD && "toJava".equals(i.getSimpleName().toString())) { Exec...
java
public static String detectSourceType(Element element, String adapterClazz) { TypeElement a = BaseProcessor.elementUtils.getTypeElement(adapterClazz); for (Element i : BaseProcessor.elementUtils.getAllMembers(a)) { if (i.getKind() == ElementKind.METHOD && "toJava".equals(i.getSimpleName().toString())) { Exec...
[ "public", "static", "String", "detectSourceType", "(", "Element", "element", ",", "String", "adapterClazz", ")", "{", "TypeElement", "a", "=", "BaseProcessor", ".", "elementUtils", ".", "getTypeElement", "(", "adapterClazz", ")", ";", "for", "(", "Element", "i",...
Detect source type. @param element the element @param adapterClazz the adapter clazz @return the string
[ "Detect", "source", "type", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/TypeAdapterHelper.java#L51-L62
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/TypeAdapterHelper.java
TypeAdapterHelper.detectSourceType
public static String detectSourceType(SQLiteModelMethod method, TypeName adapterTypeName) { TypeElement a = BaseProcessor.elementUtils.getTypeElement(adapterTypeName.toString()); for (Element i : BaseProcessor.elementUtils.getAllMembers(a)) { if (i.getKind() == ElementKind.METHOD && "toJava".equals(i.getSimpleNa...
java
public static String detectSourceType(SQLiteModelMethod method, TypeName adapterTypeName) { TypeElement a = BaseProcessor.elementUtils.getTypeElement(adapterTypeName.toString()); for (Element i : BaseProcessor.elementUtils.getAllMembers(a)) { if (i.getKind() == ElementKind.METHOD && "toJava".equals(i.getSimpleNa...
[ "public", "static", "String", "detectSourceType", "(", "SQLiteModelMethod", "method", ",", "TypeName", "adapterTypeName", ")", "{", "TypeElement", "a", "=", "BaseProcessor", ".", "elementUtils", ".", "getTypeElement", "(", "adapterTypeName", ".", "toString", "(", ")...
Give a param with type adapter, obtain type used to convert param
[ "Give", "a", "param", "with", "type", "adapter", "obtain", "type", "used", "to", "convert", "param" ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/TypeAdapterHelper.java#L67-L78
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.ensureElementsCapacity
protected void ensureElementsCapacity() { final int elStackSize = elName.length; // assert (depth + 1) >= elName.length; // we add at least one extra slot ... final int newSize = (depth >= 7 ? 2 * depth : 8) + 2; // = lucky 7 + 1 // //25 if (TRACE_SIZING) { System.err.println(getClass().get...
java
protected void ensureElementsCapacity() { final int elStackSize = elName.length; // assert (depth + 1) >= elName.length; // we add at least one extra slot ... final int newSize = (depth >= 7 ? 2 * depth : 8) + 2; // = lucky 7 + 1 // //25 if (TRACE_SIZING) { System.err.println(getClass().get...
[ "protected", "void", "ensureElementsCapacity", "(", ")", "{", "final", "int", "elStackSize", "=", "elName", ".", "length", ";", "// assert (depth + 1) >= elName.length;", "// we add at least one extra slot ...", "final", "int", "newSize", "=", "(", "depth", ">=", "7", ...
Ensure elements capacity.
[ "Ensure", "elements", "capacity", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L246-L281
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.ensureNamespacesCapacity
protected void ensureNamespacesCapacity() { // int size) { // int namespaceSize = namespacePrefix != null ? namespacePrefix.length // : 0; // assert (namespaceEnd >= namespacePrefix.length); // if(size >= namespaceSize) { // int newSize = size > 7 ? 2 * size : 8; // = lucky 7 + 1 //25 final int newSize = n...
java
protected void ensureNamespacesCapacity() { // int size) { // int namespaceSize = namespacePrefix != null ? namespacePrefix.length // : 0; // assert (namespaceEnd >= namespacePrefix.length); // if(size >= namespaceSize) { // int newSize = size > 7 ? 2 * size : 8; // = lucky 7 + 1 //25 final int newSize = n...
[ "protected", "void", "ensureNamespacesCapacity", "(", ")", "{", "// int size) {", "// int namespaceSize = namespacePrefix != null ? namespacePrefix.length", "// : 0;", "// assert (namespaceEnd >= namespacePrefix.length);", "// if(size >= namespaceSize) {", "// int newSize = size > 7 ? 2 * size...
Ensure namespaces capacity.
[ "Ensure", "namespaces", "capacity", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L286-L318
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.setFeature
public void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException { if (name == null) { throw new IllegalArgumentException("feature name can not be null"); } if (FEATURE_NAMES_INTERNED.equals(name)) { namesInterned = state; } else if (FEATURE_SERIALIZER_ATTVALUE_USE...
java
public void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException { if (name == null) { throw new IllegalArgumentException("feature name can not be null"); } if (FEATURE_NAMES_INTERNED.equals(name)) { namesInterned = state; } else if (FEATURE_SERIALIZER_ATTVALUE_USE...
[ "public", "void", "setFeature", "(", "String", "name", ",", "boolean", "state", ")", "throws", "IllegalArgumentException", ",", "IllegalStateException", "{", "if", "(", "name", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"feature nam...
Sets the feature. @param name the name @param state the state @throws IllegalArgumentException the illegal argument exception @throws IllegalStateException the illegal state exception
[ "Sets", "the", "feature", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L328-L339
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.getFeature
public boolean getFeature(String name) throws IllegalArgumentException { if (name == null) { throw new IllegalArgumentException("feature name can not be null"); } if (FEATURE_NAMES_INTERNED.equals(name)) { return namesInterned; } else if (FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE.equals(name)) { retur...
java
public boolean getFeature(String name) throws IllegalArgumentException { if (name == null) { throw new IllegalArgumentException("feature name can not be null"); } if (FEATURE_NAMES_INTERNED.equals(name)) { return namesInterned; } else if (FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE.equals(name)) { retur...
[ "public", "boolean", "getFeature", "(", "String", "name", ")", "throws", "IllegalArgumentException", "{", "if", "(", "name", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"feature name can not be null\"", ")", ";", "}", "if", "(", "F...
Gets the feature. @param name the name @return boolean @throws IllegalArgumentException the illegal argument exception
[ "Gets", "the", "feature", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L348-L359
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.rebuildIndentationBuf
protected void rebuildIndentationBuf() { if (doIndent == false) return; final int maxIndent = 65; // hardcoded maximum indentation size in // characters int bufSize = 0; offsetNewLine = 0; if (writeLineSepartor) { offsetNewLine = lineSeparator.length(); bufSize += offsetNewLine; } maxInd...
java
protected void rebuildIndentationBuf() { if (doIndent == false) return; final int maxIndent = 65; // hardcoded maximum indentation size in // characters int bufSize = 0; offsetNewLine = 0; if (writeLineSepartor) { offsetNewLine = lineSeparator.length(); bufSize += offsetNewLine; } maxInd...
[ "protected", "void", "rebuildIndentationBuf", "(", ")", "{", "if", "(", "doIndent", "==", "false", ")", "return", ";", "final", "int", "maxIndent", "=", "65", ";", "// hardcoded maximum indentation size in", "// characters", "int", "bufSize", "=", "0", ";", "off...
For maximum efficiency when writing indents the required output is pre-computed This is internal function that recomputes buffer after user requested chnages.
[ "For", "maximum", "efficiency", "when", "writing", "indents", "the", "required", "output", "is", "pre", "-", "computed", "This", "is", "internal", "function", "that", "recomputes", "buffer", "after", "user", "requested", "chnages", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L385-L418
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.setProperty
public void setProperty(String name, Object value) throws IllegalArgumentException, IllegalStateException { if (name == null) { throw new IllegalArgumentException("property name can not be null"); } if (PROPERTY_SERIALIZER_INDENTATION.equals(name)) { indentationString = (String) value; } else if (PROPERTY...
java
public void setProperty(String name, Object value) throws IllegalArgumentException, IllegalStateException { if (name == null) { throw new IllegalArgumentException("property name can not be null"); } if (PROPERTY_SERIALIZER_INDENTATION.equals(name)) { indentationString = (String) value; } else if (PROPERTY...
[ "public", "void", "setProperty", "(", "String", "name", ",", "Object", "value", ")", "throws", "IllegalArgumentException", ",", "IllegalStateException", "{", "if", "(", "name", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"property na...
Sets the property. @param name the name @param value the value @throws IllegalArgumentException the illegal argument exception @throws IllegalStateException the illegal state exception
[ "Sets", "the", "property", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L440-L461
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.setOutput
public void setOutput(OutputStream os, String encoding) throws IOException { if (os == null) throw new IllegalArgumentException("output stream can not be null"); reset(); if (encoding != null) { out = new OutputStreamWriter(os, encoding); } else { out = new OutputStreamWriter(os); } }
java
public void setOutput(OutputStream os, String encoding) throws IOException { if (os == null) throw new IllegalArgumentException("output stream can not be null"); reset(); if (encoding != null) { out = new OutputStreamWriter(os, encoding); } else { out = new OutputStreamWriter(os); } }
[ "public", "void", "setOutput", "(", "OutputStream", "os", ",", "String", "encoding", ")", "throws", "IOException", "{", "if", "(", "os", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"output stream can not be null\"", ")", ";", "reset", "...
Sets the output. @param os the os @param encoding the encoding @throws IOException Signals that an I/O exception has occurred.
[ "Sets", "the", "output", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L521-L530
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.startDocument
public void startDocument(String encoding, Boolean standalone) throws IOException { @SuppressWarnings("unused") char apos = attributeUseApostrophe ? '\'' : '"'; if (attributeUseApostrophe) { out.write("<?xml version='1.0'"); } else { out.write("<?xml version=\"1.0\""); } if (encoding != null) { out...
java
public void startDocument(String encoding, Boolean standalone) throws IOException { @SuppressWarnings("unused") char apos = attributeUseApostrophe ? '\'' : '"'; if (attributeUseApostrophe) { out.write("<?xml version='1.0'"); } else { out.write("<?xml version=\"1.0\""); } if (encoding != null) { out...
[ "public", "void", "startDocument", "(", "String", "encoding", ",", "Boolean", "standalone", ")", "throws", "IOException", "{", "@", "SuppressWarnings", "(", "\"unused\"", ")", "char", "apos", "=", "attributeUseApostrophe", "?", "'", "'", ":", "'", "'", ";", ...
Start document. @param encoding the encoding @param standalone the standalone @throws IOException Signals that an I/O exception has occurred.
[ "Start", "document", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L539-L570
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.setPrefix
@SuppressWarnings("unused") public void setPrefix(String prefix, String namespace) throws IOException { if (startTagIncomplete) closeStartTag(); // assert prefix != null; // assert namespace != null; if (prefix == null) { prefix = ""; } if (!namesInterned) { prefix = prefix.intern(); // will throw...
java
@SuppressWarnings("unused") public void setPrefix(String prefix, String namespace) throws IOException { if (startTagIncomplete) closeStartTag(); // assert prefix != null; // assert namespace != null; if (prefix == null) { prefix = ""; } if (!namesInterned) { prefix = prefix.intern(); // will throw...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "void", "setPrefix", "(", "String", "prefix", ",", "String", "namespace", ")", "throws", "IOException", "{", "if", "(", "startTagIncomplete", ")", "closeStartTag", "(", ")", ";", "// assert prefix != null;...
Sets the prefix. @param prefix the prefix @param namespace the namespace @throws IOException Signals that an I/O exception has occurred.
[ "Sets", "the", "prefix", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L595-L634
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.getPrefix
protected String getPrefix(String namespace, boolean generatePrefix, boolean nonEmpty) { // assert namespace != null; if (!namesInterned) { // when String is interned we can do much faster namespace stack // lookups ... namespace = namespace.intern(); } else if (checkNamesInterned) { checkInterning(na...
java
protected String getPrefix(String namespace, boolean generatePrefix, boolean nonEmpty) { // assert namespace != null; if (!namesInterned) { // when String is interned we can do much faster namespace stack // lookups ... namespace = namespace.intern(); } else if (checkNamesInterned) { checkInterning(na...
[ "protected", "String", "getPrefix", "(", "String", "namespace", ",", "boolean", "generatePrefix", ",", "boolean", "nonEmpty", ")", "{", "// assert namespace != null;", "if", "(", "!", "namesInterned", ")", "{", "// when String is interned we can do much faster namespace sta...
Gets the prefix. @param namespace the namespace @param generatePrefix the generate prefix @param nonEmpty the non empty @return prefix
[ "Gets", "the", "prefix", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L665-L702
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.generatePrefix
private String generatePrefix(String namespace) { // assert namespace == namespace.intern(); while (true) { ++autoDeclaredPrefixes; // fast lookup uses table that was pre-initialized in static{} .... final String prefix = autoDeclaredPrefixes < precomputedPrefixes.length ? precomputedPrefixes[autoDeclaredP...
java
private String generatePrefix(String namespace) { // assert namespace == namespace.intern(); while (true) { ++autoDeclaredPrefixes; // fast lookup uses table that was pre-initialized in static{} .... final String prefix = autoDeclaredPrefixes < precomputedPrefixes.length ? precomputedPrefixes[autoDeclaredP...
[ "private", "String", "generatePrefix", "(", "String", "namespace", ")", "{", "// assert namespace == namespace.intern();", "while", "(", "true", ")", "{", "++", "autoDeclaredPrefixes", ";", "// fast lookup uses table that was pre-initialized in static{} ....", "final", "String"...
Generate prefix. @param namespace the namespace @return the string
[ "Generate", "prefix", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L710-L735
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.closeStartTag
protected void closeStartTag() throws IOException { if (finished) { throw new IllegalArgumentException("trying to write past already finished output" + getLocation()); } if (seenBracket) { seenBracket = seenBracketBracket = false; } if (startTagIncomplete || setPrefixCalled) { if (setPrefixCalled) { ...
java
protected void closeStartTag() throws IOException { if (finished) { throw new IllegalArgumentException("trying to write past already finished output" + getLocation()); } if (seenBracket) { seenBracket = seenBracketBracket = false; } if (startTagIncomplete || setPrefixCalled) { if (setPrefixCalled) { ...
[ "protected", "void", "closeStartTag", "(", ")", "throws", "IOException", "{", "if", "(", "finished", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"trying to write past already finished output\"", "+", "getLocation", "(", ")", ")", ";", "}", "if", "...
Close start tag. @throws IOException Signals that an I/O exception has occurred.
[ "Close", "start", "tag", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L915-L936
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.writeNamespaceDeclarations
private void writeNamespaceDeclarations() throws IOException { // int start = elNamespaceCount[ depth - 1 ]; for (int i = elNamespaceCount[depth - 1]; i < namespaceEnd; i++) { if (doIndent && namespaceUri[i].length() > 40) { writeIndent(); out.write(" "); } if ("".equals(namespacePrefix[i])) { ...
java
private void writeNamespaceDeclarations() throws IOException { // int start = elNamespaceCount[ depth - 1 ]; for (int i = elNamespaceCount[depth - 1]; i < namespaceEnd; i++) { if (doIndent && namespaceUri[i].length() > 40) { writeIndent(); out.write(" "); } if ("".equals(namespacePrefix[i])) { ...
[ "private", "void", "writeNamespaceDeclarations", "(", ")", "throws", "IOException", "{", "// int start = elNamespaceCount[ depth - 1 ];", "for", "(", "int", "i", "=", "elNamespaceCount", "[", "depth", "-", "1", "]", ";", "i", "<", "namespaceEnd", ";", "i", "++", ...
Write namespace declarations. @throws IOException Signals that an I/O exception has occurred.
[ "Write", "namespace", "declarations", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L943-L964
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.endTag
public XMLSerializer endTag(String namespace, String name) throws IOException { // check that level is valid //// assert namespace != null; // if(namespace != null) { // namespace = namespace.intern(); // } seenBracket = seenBracketBracket = false; if (namespace != null) { if (!namesInterned) { nam...
java
public XMLSerializer endTag(String namespace, String name) throws IOException { // check that level is valid //// assert namespace != null; // if(namespace != null) { // namespace = namespace.intern(); // } seenBracket = seenBracketBracket = false; if (namespace != null) { if (!namesInterned) { nam...
[ "public", "XMLSerializer", "endTag", "(", "String", "namespace", ",", "String", "name", ")", "throws", "IOException", "{", "// check that level is valid", "//// assert namespace != null;", "// if(namespace != null) {", "// namespace = namespace.intern();", "// }", "seenBracket", ...
End tag. @param namespace the namespace @param name the name @return serializer @throws IOException Signals that an I/O exception has occurred.
[ "End", "tag", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L974-L1037
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.entityRef
public void entityRef(String text) throws IOException { if (startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if (doIndent && seenTag) seenTag = false; out.write('&'); out.write(text); // escape? out.write(';'); }
java
public void entityRef(String text) throws IOException { if (startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if (doIndent && seenTag) seenTag = false; out.write('&'); out.write(text); // escape? out.write(';'); }
[ "public", "void", "entityRef", "(", "String", "text", ")", "throws", "IOException", "{", "if", "(", "startTagIncomplete", "||", "setPrefixCalled", "||", "seenBracket", ")", "closeStartTag", "(", ")", ";", "if", "(", "doIndent", "&&", "seenTag", ")", "seenTag",...
Entity ref. @param text the text @throws IOException Signals that an I/O exception has occurred.
[ "Entity", "ref", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1096-L1104
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.ignorableWhitespace
public void ignorableWhitespace(String text) throws IOException { if (startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if (doIndent && seenTag) seenTag = false; if (text.length() == 0) { throw new IllegalArgumentException("empty string is not allowed for ignorable whitespace" + getL...
java
public void ignorableWhitespace(String text) throws IOException { if (startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if (doIndent && seenTag) seenTag = false; if (text.length() == 0) { throw new IllegalArgumentException("empty string is not allowed for ignorable whitespace" + getL...
[ "public", "void", "ignorableWhitespace", "(", "String", "text", ")", "throws", "IOException", "{", "if", "(", "startTagIncomplete", "||", "setPrefixCalled", "||", "seenBracket", ")", "closeStartTag", "(", ")", ";", "if", "(", "doIndent", "&&", "seenTag", ")", ...
Ignorable whitespace. @param text the text @throws IOException Signals that an I/O exception has occurred.
[ "Ignorable", "whitespace", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1160-L1169
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.writeAttributeValue
protected void writeAttributeValue(String value, Writer out) throws IOException { // .[apostrophe and <, & escaped], final char quot = attributeUseApostrophe ? '\'' : '"'; final String quotEntity = attributeUseApostrophe ? "&apos;" : "&quot;"; int pos = 0; for (int i = 0; i < value.length(); i++) { char c...
java
protected void writeAttributeValue(String value, Writer out) throws IOException { // .[apostrophe and <, & escaped], final char quot = attributeUseApostrophe ? '\'' : '"'; final String quotEntity = attributeUseApostrophe ? "&apos;" : "&quot;"; int pos = 0; for (int i = 0; i < value.length(); i++) { char c...
[ "protected", "void", "writeAttributeValue", "(", "String", "value", ",", "Writer", "out", ")", "throws", "IOException", "{", "// .[apostrophe and <, & escaped],", "final", "char", "quot", "=", "attributeUseApostrophe", "?", "'", "'", ":", "'", "'", ";", "final", ...
Write attribute value. @param value the value @param out the out @throws IOException Signals that an I/O exception has occurred.
[ "Write", "attribute", "value", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1191-L1255
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.addPrintable
private static void addPrintable(StringBuffer retval, char ch) { switch (ch) { case '\b': retval.append("\\b"); break; case '\t': retval.append("\\t"); break; case '\n': retval.append("\\n"); break; case '\f': retval.append("\\f"); break; case '\r': retval.append("\\r"); break;...
java
private static void addPrintable(StringBuffer retval, char ch) { switch (ch) { case '\b': retval.append("\\b"); break; case '\t': retval.append("\\t"); break; case '\n': retval.append("\\n"); break; case '\f': retval.append("\\f"); break; case '\r': retval.append("\\r"); break;...
[ "private", "static", "void", "addPrintable", "(", "StringBuffer", "retval", ",", "char", "ch", ")", "{", "switch", "(", "ch", ")", "{", "case", "'", "'", ":", "retval", ".", "append", "(", "\"\\\\b\"", ")", ";", "break", ";", "case", "'", "'", ":", ...
Adds the printable. @param retval the retval @param ch the ch
[ "Adds", "the", "printable", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1457-L1491
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.writeBinary
public void writeBinary(byte[] value, int start, int length) throws IOException { text(Base64Utils.encode(value, start, length)); }
java
public void writeBinary(byte[] value, int start, int length) throws IOException { text(Base64Utils.encode(value, start, length)); }
[ "public", "void", "writeBinary", "(", "byte", "[", "]", "value", ",", "int", "start", ",", "int", "length", ")", "throws", "IOException", "{", "text", "(", "Base64Utils", ".", "encode", "(", "value", ",", "start", ",", "length", ")", ")", ";", "}" ]
Write binary. @param value the value @param start the start @param length the length @throws IOException Signals that an I/O exception has occurred.
[ "Write", "binary", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1621-L1623
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.writeDecimalAttribute
public void writeDecimalAttribute(String prefix, String namespaceURI, String localName, BigDecimal value) throws Exception { this.attribute(namespaceURI, localName, value.toPlainString()); }
java
public void writeDecimalAttribute(String prefix, String namespaceURI, String localName, BigDecimal value) throws Exception { this.attribute(namespaceURI, localName, value.toPlainString()); }
[ "public", "void", "writeDecimalAttribute", "(", "String", "prefix", ",", "String", "namespaceURI", ",", "String", "localName", ",", "BigDecimal", "value", ")", "throws", "Exception", "{", "this", ".", "attribute", "(", "namespaceURI", ",", "localName", ",", "val...
Write decimal attribute. @param prefix the prefix @param namespaceURI the namespace URI @param localName the local name @param value the value @throws Exception the exception
[ "Write", "decimal", "attribute", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1644-L1646
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.writeIntegerAttribute
public void writeIntegerAttribute(String prefix, String namespaceURI, String localName, BigInteger value) throws Exception { this.attribute(namespaceURI, localName, value.toString()); }
java
public void writeIntegerAttribute(String prefix, String namespaceURI, String localName, BigInteger value) throws Exception { this.attribute(namespaceURI, localName, value.toString()); }
[ "public", "void", "writeIntegerAttribute", "(", "String", "prefix", ",", "String", "namespaceURI", ",", "String", "localName", ",", "BigInteger", "value", ")", "throws", "Exception", "{", "this", ".", "attribute", "(", "namespaceURI", ",", "localName", ",", "val...
Write integer attribute. @param prefix the prefix @param namespaceURI the namespace URI @param localName the local name @param value the value @throws Exception the exception
[ "Write", "integer", "attribute", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1657-L1660
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.writeDoubleAttribute
public void writeDoubleAttribute(String prefix, String namespaceURI, String localName, double value) throws Exception { this.attribute(namespaceURI, localName, Double.toString(value)); }
java
public void writeDoubleAttribute(String prefix, String namespaceURI, String localName, double value) throws Exception { this.attribute(namespaceURI, localName, Double.toString(value)); }
[ "public", "void", "writeDoubleAttribute", "(", "String", "prefix", ",", "String", "namespaceURI", ",", "String", "localName", ",", "double", "value", ")", "throws", "Exception", "{", "this", ".", "attribute", "(", "namespaceURI", ",", "localName", ",", "Double",...
Write double attribute. @param prefix the prefix @param namespaceURI the namespace URI @param localName the local name @param value the value @throws Exception the exception
[ "Write", "double", "attribute", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1681-L1684
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.writeBooleanAttribute
public void writeBooleanAttribute(String prefix, String namespaceURI, String localName, boolean value) throws Exception { this.attribute(namespaceURI, localName, Boolean.toString(value)); }
java
public void writeBooleanAttribute(String prefix, String namespaceURI, String localName, boolean value) throws Exception { this.attribute(namespaceURI, localName, Boolean.toString(value)); }
[ "public", "void", "writeBooleanAttribute", "(", "String", "prefix", ",", "String", "namespaceURI", ",", "String", "localName", ",", "boolean", "value", ")", "throws", "Exception", "{", "this", ".", "attribute", "(", "namespaceURI", ",", "localName", ",", "Boolea...
Write boolean attribute. @param prefix the prefix @param namespaceURI the namespace URI @param localName the local name @param value the value @throws Exception the exception
[ "Write", "boolean", "attribute", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1707-L1710
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java
ManagedPropertyPersistenceHelper.generateFieldPersistance
public static void generateFieldPersistance(BindTypeContext context, List<? extends ManagedModelProperty> collection, PersistType persistType, boolean forceName, Modifier... modifiers) { for (ManagedModelProperty property : collection) { if (property.bindProperty != null && !property.hasTypeAdapter()) { // if...
java
public static void generateFieldPersistance(BindTypeContext context, List<? extends ManagedModelProperty> collection, PersistType persistType, boolean forceName, Modifier... modifiers) { for (ManagedModelProperty property : collection) { if (property.bindProperty != null && !property.hasTypeAdapter()) { // if...
[ "public", "static", "void", "generateFieldPersistance", "(", "BindTypeContext", "context", ",", "List", "<", "?", "extends", "ManagedModelProperty", ">", "collection", ",", "PersistType", "persistType", ",", "boolean", "forceName", ",", "Modifier", "...", "modifiers",...
Manage field's persistence for both in SharedPreference and SQLite flavours. @param context the context @param collection the collection @param persistType the persist type @param forceName the force name @param modifiers the modifiers
[ "Manage", "field", "s", "persistence", "for", "both", "in", "SharedPreference", "and", "SQLite", "flavours", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java#L75-L91
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java
ManagedPropertyPersistenceHelper.generateFieldSerialize
public static void generateFieldSerialize(BindTypeContext context, PersistType persistType, BindProperty property, Modifier... modifiers) { Converter<String, String> format = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL); String methodName = "serialize" + format.convert(property.getName()); MethodS...
java
public static void generateFieldSerialize(BindTypeContext context, PersistType persistType, BindProperty property, Modifier... modifiers) { Converter<String, String> format = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL); String methodName = "serialize" + format.convert(property.getName()); MethodS...
[ "public", "static", "void", "generateFieldSerialize", "(", "BindTypeContext", "context", ",", "PersistType", "persistType", ",", "BindProperty", "property", ",", "Modifier", "...", "modifiers", ")", "{", "Converter", "<", "String", ",", "String", ">", "format", "=...
generates code to manage field serialization. @param context the context @param persistType the persist type @param property the property @param modifiers the modifiers
[ "generates", "code", "to", "manage", "field", "serialization", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java#L101-L163
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java
ManagedPropertyPersistenceHelper.generateParamSerializer
public static void generateParamSerializer(BindTypeContext context, String propertyName, TypeName parameterTypeName, PersistType persistType) { propertyName = SQLiteDaoDefinition.PARAM_SERIALIZER_PREFIX + propertyName; MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(propertyName).addJavadoc("for param ...
java
public static void generateParamSerializer(BindTypeContext context, String propertyName, TypeName parameterTypeName, PersistType persistType) { propertyName = SQLiteDaoDefinition.PARAM_SERIALIZER_PREFIX + propertyName; MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(propertyName).addJavadoc("for param ...
[ "public", "static", "void", "generateParamSerializer", "(", "BindTypeContext", "context", ",", "String", "propertyName", ",", "TypeName", "parameterTypeName", ",", "PersistType", "persistType", ")", "{", "propertyName", "=", "SQLiteDaoDefinition", ".", "PARAM_SERIALIZER_P...
Generate param serializer. @param context the context @param propertyName the property name @param parameterTypeName the parameter type name @param persistType the persist type
[ "Generate", "param", "serializer", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java#L244-L303
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java
ManagedPropertyPersistenceHelper.generateParamParser
public static void generateParamParser(BindTypeContext context, String methodName, TypeName parameterTypeName, PersistType persistType) { methodName = SQLiteDaoDefinition.PARAM_PARSER_PREFIX + methodName; MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(methodName).addJavadoc("for param $L parsing\n", m...
java
public static void generateParamParser(BindTypeContext context, String methodName, TypeName parameterTypeName, PersistType persistType) { methodName = SQLiteDaoDefinition.PARAM_PARSER_PREFIX + methodName; MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(methodName).addJavadoc("for param $L parsing\n", m...
[ "public", "static", "void", "generateParamParser", "(", "BindTypeContext", "context", ",", "String", "methodName", ",", "TypeName", "parameterTypeName", ",", "PersistType", "persistType", ")", "{", "methodName", "=", "SQLiteDaoDefinition", ".", "PARAM_PARSER_PREFIX", "+...
Generate param parser. @param context the context @param methodName the method name @param parameterTypeName the parameter type name @param persistType the persist type
[ "Generate", "param", "parser", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java#L313-L360
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelProperty.java
ModelProperty.checkTypeAdapter
protected void checkTypeAdapter(@SuppressWarnings("rawtypes") ModelEntity entity, TypeMirror propertyType, TypeAdapter typeAdapter, ModelAnnotation annotation) { TypeName sourceType = TypeUtility.typeName(TypeAdapterHelper.detectSourceType(entity.getElement(), typeAdapter.adapterClazz)); TypeName uboxSourceType=sou...
java
protected void checkTypeAdapter(@SuppressWarnings("rawtypes") ModelEntity entity, TypeMirror propertyType, TypeAdapter typeAdapter, ModelAnnotation annotation) { TypeName sourceType = TypeUtility.typeName(TypeAdapterHelper.detectSourceType(entity.getElement(), typeAdapter.adapterClazz)); TypeName uboxSourceType=sou...
[ "protected", "void", "checkTypeAdapter", "(", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "ModelEntity", "entity", ",", "TypeMirror", "propertyType", ",", "TypeAdapter", "typeAdapter", ",", "ModelAnnotation", "annotation", ")", "{", "TypeName", "sourceType", "=...
Check type adapter. @param entity the entity @param propertyType the property type @param typeAdapter the type adapter @param annotation the annotation
[ "Check", "type", "adapter", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelProperty.java#L78-L93
train
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/persistence/xml/internal/StringPool.java
StringPool.contentEquals
private static boolean contentEquals(String s, char[] chars, int start, int length) { if (s.length() != length) { return false; } for (int i = 0; i < length; i++) { if (chars[start + i] != s.charAt(i)) { return false; } } return true; }
java
private static boolean contentEquals(String s, char[] chars, int start, int length) { if (s.length() != length) { return false; } for (int i = 0; i < length; i++) { if (chars[start + i] != s.charAt(i)) { return false; } } return true; }
[ "private", "static", "boolean", "contentEquals", "(", "String", "s", ",", "char", "[", "]", "chars", ",", "int", "start", ",", "int", "length", ")", "{", "if", "(", "s", ".", "length", "(", ")", "!=", "length", ")", "{", "return", "false", ";", "}"...
Content equals. @param s the s @param chars the chars @param start the start @param length the length @return true, if successful
[ "Content", "equals", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/persistence/xml/internal/StringPool.java#L39-L49
train
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelClass.java
ModelClass.findImmutablePropertyByName
public E findImmutablePropertyByName(String name) { String lcName = name.toLowerCase(); for (E item : immutableCollection) { if (item.getName().toLowerCase().equals(lcName)) { return item; } } return null; }
java
public E findImmutablePropertyByName(String name) { String lcName = name.toLowerCase(); for (E item : immutableCollection) { if (item.getName().toLowerCase().equals(lcName)) { return item; } } return null; }
[ "public", "E", "findImmutablePropertyByName", "(", "String", "name", ")", "{", "String", "lcName", "=", "name", ".", "toLowerCase", "(", ")", ";", "for", "(", "E", "item", ":", "immutableCollection", ")", "{", "if", "(", "item", ".", "getName", "(", ")",...
Find property by name. @param name the name @return the t
[ "Find", "property", "by", "name", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelClass.java#L53-L62
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java
DynamicByteBuffer.createExact
public static DynamicByteBuffer createExact( final int capacity ) { return new DynamicByteBuffer( capacity ) { public DynamicByteBuffer add( byte[] chars ) { DynamicByteBufferHelper._idx( buffer, length, chars ); length += chars.length; return this; ...
java
public static DynamicByteBuffer createExact( final int capacity ) { return new DynamicByteBuffer( capacity ) { public DynamicByteBuffer add( byte[] chars ) { DynamicByteBufferHelper._idx( buffer, length, chars ); length += chars.length; return this; ...
[ "public", "static", "DynamicByteBuffer", "createExact", "(", "final", "int", "capacity", ")", "{", "return", "new", "DynamicByteBuffer", "(", "capacity", ")", "{", "public", "DynamicByteBuffer", "add", "(", "byte", "[", "]", "chars", ")", "{", "DynamicByteBuffer...
Creates the exact. @param capacity the capacity @return the dynamic byte buffer
[ "Creates", "the", "exact", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L77-L85
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java
DynamicByteBuffer.addUnsignedByte
public void addUnsignedByte( short value ) { if ( 1 + length < capacity ) { DynamicByteBufferHelper.unsignedByteTo( buffer, length, value ); } else { buffer = DynamicByteBufferHelper.grow( buffer, buffer.length * 2 + 1 ); capacity = buffer.length; Dynamic...
java
public void addUnsignedByte( short value ) { if ( 1 + length < capacity ) { DynamicByteBufferHelper.unsignedByteTo( buffer, length, value ); } else { buffer = DynamicByteBufferHelper.grow( buffer, buffer.length * 2 + 1 ); capacity = buffer.length; Dynamic...
[ "public", "void", "addUnsignedByte", "(", "short", "value", ")", "{", "if", "(", "1", "+", "length", "<", "capacity", ")", "{", "DynamicByteBufferHelper", ".", "unsignedByteTo", "(", "buffer", ",", "length", ",", "value", ")", ";", "}", "else", "{", "buf...
Adds the unsigned byte. @param value the value
[ "Adds", "the", "unsigned", "byte", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L372-L384
train
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java
DynamicByteBuffer.addUnsignedInt
public DynamicByteBuffer addUnsignedInt( long value ) { if ( 4 + length < capacity ) { DynamicByteBufferHelper.unsignedIntTo( buffer, length, value ); } else { buffer = DynamicByteBufferHelper.grow( buffer, buffer.length * 2 + 4 ); capacity = buffer.length; ...
java
public DynamicByteBuffer addUnsignedInt( long value ) { if ( 4 + length < capacity ) { DynamicByteBufferHelper.unsignedIntTo( buffer, length, value ); } else { buffer = DynamicByteBufferHelper.grow( buffer, buffer.length * 2 + 4 ); capacity = buffer.length; ...
[ "public", "DynamicByteBuffer", "addUnsignedInt", "(", "long", "value", ")", "{", "if", "(", "4", "+", "length", "<", "capacity", ")", "{", "DynamicByteBufferHelper", ".", "unsignedIntTo", "(", "buffer", ",", "length", ",", "value", ")", ";", "}", "else", "...
Adds the unsigned int. @param value the value @return the dynamic byte buffer
[ "Adds", "the", "unsigned", "int", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L392-L406
train