idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
128,300
public void addUnsignedShort ( int value ) { if ( 2 + length < capacity ) { DynamicByteBufferHelper . unsignedShortTo ( buffer , length , value ) ; } else { buffer = DynamicByteBufferHelper . grow ( buffer , buffer . length * 2 + 2 ) ; capacity = buffer . length ; DynamicByteBufferHelper . unsignedShortTo ( buffer , le...
Adds the unsigned short .
128,301
public void writeLargeDoubleArray ( double [ ] values ) { int byteSize = values . length * 8 + 4 ; this . add ( values . length ) ; doWriteDoubleArray ( values , byteSize ) ; }
Write large double array .
128,302
public void writeLargeLongArray ( long [ ] values ) { int byteSize = values . length * 8 + 4 ; this . add ( values . length ) ; doWriteLongArray ( values , byteSize ) ; }
Write large long array .
128,303
public void writeLargeString ( String s ) { final byte [ ] bytes = DynamicByteBufferHelper . bytes ( s ) ; this . add ( bytes . length ) ; this . add ( bytes ) ; }
Write large string .
128,304
public void writeMediumDoubleArray ( double [ ] values ) { int byteSize = values . length * 8 + 2 ; this . addUnsignedShort ( values . length ) ; doWriteDoubleArray ( values , byteSize ) ; }
Write medium double array .
128,305
public void writeMediumFloatArray ( float [ ] values ) { int byteSize = values . length * 4 + 2 ; this . addUnsignedShort ( values . length ) ; doWriteFloatArray ( values , byteSize ) ; }
Write medium float array .
128,306
public void writeMediumLongArray ( long [ ] values ) { int byteSize = values . length * 8 + 2 ; this . addUnsignedShort ( values . length ) ; doWriteLongArray ( values , byteSize ) ; }
Write medium long array .
128,307
public void writeMediumShortArray ( short [ ] values ) { int byteSize = values . length * 2 + 2 ; this . addUnsignedShort ( values . length ) ; doWriteShortArray ( values , byteSize ) ; }
Write medium short array .
128,308
public void writeMediumString ( String s ) { final byte [ ] bytes = DynamicByteBufferHelper . bytes ( s ) ; this . addUnsignedShort ( bytes . length ) ; this . add ( bytes ) ; }
Write medium string .
128,309
public void writeSmallDoubleArray ( double [ ] values ) { int byteSize = values . length * 8 + 1 ; this . addUnsignedByte ( ( short ) values . length ) ; doWriteDoubleArray ( values , byteSize ) ; }
Write small double array .
128,310
public void writeSmallLongArray ( long [ ] values ) { int byteSize = values . length * 8 + 1 ; this . addUnsignedByte ( ( short ) values . length ) ; doWriteLongArray ( values , byteSize ) ; }
Write small long array .
128,311
public void writeSmallShortArray ( short [ ] values ) { int byteSize = values . length * 2 + 1 ; this . addUnsignedByte ( ( short ) values . length ) ; doWriteShortArray ( values , byteSize ) ; }
Write small short array .
128,312
public void writeSmallString ( String s ) { final byte [ ] bytes = DynamicByteBufferHelper . bytes ( s ) ; this . addUnsignedByte ( ( short ) bytes . length ) ; this . add ( bytes ) ; }
Write small string .
128,313
public String getQualifiedName ( ) { if ( StringUtils . hasText ( packageName ) ) { return packageName + "." + typeSpec . name ; } return typeSpec . name ; }
Gets the qualified name .
128,314
public static void writeJava2File ( Filer filer , String packageName , TypeSpec typeSpec ) throws IOException { JavaFile target = JavaFile . builder ( packageName , typeSpec ) . skipJavaLangImports ( true ) . build ( ) ; target . writeTo ( filer ) ; }
Write java 2 file .
128,315
public static ClassName generateDaoFactoryClassName ( SQLiteDatabaseSchema schema ) { String schemaName = buildDaoFactoryName ( schema ) ; String packageName = TypeUtility . extractPackageName ( schema . getElement ( ) ) ; return ClassName . get ( packageName , schemaName ) ; }
Given a schema generate its daoFactory name .
128,316
public static void init ( Context contextValue , ExecutorService service ) { context = contextValue ; if ( service == null ) { executerService = Executors . newFixedThreadPool ( THREAD_POOL_SIZE_DEFAULT ) ; } else { executerService = service ; } }
Method to invoke during application initialization .
128,317
private MethodSpec . Builder generateExecuteMethod ( String packageName , SQLiteEntity entity ) { ParameterizedTypeName parameterizedReturnTypeName = ParameterizedTypeName . get ( className ( ArrayList . class ) , className ( packageName , entity . getSimpleName ( ) ) ) ; MethodSpec . Builder methodBuilder = MethodSpec...
Generate execute method .
128,318
protected Class < ? > defineCollectionClass ( ParameterizedTypeName collectionTypeName ) { if ( collectionTypeName . rawType . toString ( ) . startsWith ( collectionClazz . getCanonicalName ( ) ) ) { return defaultClazz ; } else if ( collectionTypeName . rawType . toString ( ) . startsWith ( SortedMap . class . getCano...
Define collection class .
128,319
public static ClassName defineCollection ( TypeName listClazzName ) { try { Class < ? > clazz = null ; if ( listClazzName instanceof ParameterizedTypeName ) { ParameterizedTypeName returnListName = ( ParameterizedTypeName ) listClazzName ; clazz = Class . forName ( returnListName . rawType . toString ( ) ) ; } else { c...
Define collection .
128,320
public void putNull ( String key ) { if ( this . compiledStatement != null ) { compiledStatement . bindNull ( compiledStatementBindIndex ++ ) ; } else if ( values != null ) { values . putNull ( key ) ; return ; } names . add ( key ) ; args . add ( null ) ; valueType . add ( ParamType . NULL ) ; }
Adds a null value to the set .
128,321
public void addWhereArgs ( String value ) { if ( this . compiledStatement != null ) { compiledStatement . bindString ( compiledStatementBindIndex ++ , value ) ; } whereArgs . add ( value ) ; valueType . add ( ParamType . STRING ) ; }
Adds the where args .
128,322
public void clear ( ) { names . clear ( ) ; values = null ; valueType . clear ( ) ; args . clear ( ) ; whereArgs . clear ( ) ; compiledStatement = null ; compiledStatementBindIndex = 1 ; }
Removes all values .
128,323
public String keyList ( ) { String separator = "" ; StringBuilder buffer = new StringBuilder ( ) ; String item ; for ( int i = 0 ; i < names . size ( ) ; i ++ ) { item = names . get ( i ) ; buffer . append ( separator + item ) ; separator = ", " ; } return buffer . toString ( ) ; }
Key list .
128,324
public String keyValueList ( ) { String separator = "" ; StringBuilder buffer = new StringBuilder ( ) ; for ( int i = 0 ; i < names . size ( ) ; i ++ ) { buffer . append ( separator + "?" ) ; separator = ", " ; } return buffer . toString ( ) ; }
Key value list .
128,325
private Class < ? > replaceInterface ( Class < ? > clazz ) { if ( clazz . equals ( List . class ) ) { return ArrayList . class ; } if ( clazz . equals ( Set . class ) ) { return HashSet . class ; } if ( clazz . equals ( Map . class ) ) { return HashMap . class ; } return clazz ; }
Replace interface .
128,326
private void checkRelaxed ( String errorMessage ) { if ( ! relaxed ) { throw new KriptonRuntimeException ( errorMessage , true , this . getLineNumber ( ) , this . getColumnNumber ( ) , getPositionDescription ( ) , null ) ; } if ( error == null ) { error = "Error: " + errorMessage ; } }
Check relaxed .
128,327
private String readUntil ( char [ ] delimiter , boolean returnText ) throws IOException , KriptonRuntimeException { int start = position ; StringBuilder result = null ; if ( returnText && text != null ) { result = new StringBuilder ( ) ; result . append ( text ) ; } search : while ( true ) { if ( position + delimiter ....
Reads text until the specified delimiter is encountered . Consumes the text and the delimiter .
128,328
private void readXmlDeclaration ( ) throws IOException , KriptonRuntimeException { if ( bufferStartLine != 0 || bufferStartColumn != 0 || position != 0 ) { checkRelaxed ( "processing instructions must not start with xml" ) ; } read ( START_PROCESSING_INSTRUCTION ) ; parseStartTag ( true , true ) ; if ( attributeCount <...
Returns true if an XML declaration was read .
128,329
private String readComment ( boolean returnText ) throws IOException , KriptonRuntimeException { read ( START_COMMENT ) ; if ( relaxed ) { return readUntil ( END_COMMENT , returnText ) ; } String commentText = readUntil ( COMMENT_DOUBLE_DASH , returnText ) ; if ( peekCharacter ( ) != '>' ) { throw new KriptonRuntimeExc...
Read comment .
128,330
private void readInternalSubset ( ) throws IOException , KriptonRuntimeException { read ( '[' ) ; while ( true ) { skip ( ) ; if ( peekCharacter ( ) == ']' ) { position ++ ; return ; } int declarationType = peekType ( true ) ; switch ( declarationType ) { case ELEMENTDECL : readElementDeclaration ( ) ; break ; case ATT...
Read internal subset .
128,331
private void readNotationDeclaration ( ) throws IOException , KriptonRuntimeException { read ( START_NOTATION ) ; skip ( ) ; readName ( ) ; if ( ! readExternalId ( false , false ) ) { throw new KriptonRuntimeException ( "Expected external ID or public ID for notation" , true , this . getLineNumber ( ) , this . getColum...
Read notation declaration .
128,332
private void readEndTag ( ) throws IOException , KriptonRuntimeException { read ( '<' ) ; read ( '/' ) ; name = readName ( ) ; skip ( ) ; read ( '>' ) ; int sp = ( depth - 1 ) * 4 ; if ( depth == 0 ) { checkRelaxed ( "read end tag " + name + " with no tags open" ) ; type = COMMENT ; return ; } if ( name . equals ( elem...
Read end tag .
128,333
private String readName ( ) throws IOException , KriptonRuntimeException { if ( position >= limit && ! fillBuffer ( 1 ) ) { checkRelaxed ( "name expected" ) ; return "" ; } int start = position ; StringBuilder result = null ; char c = buffer [ position ] ; if ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || c ...
Returns an element or attribute name . This is always non - empty for non - relaxed parsers .
128,334
public T get ( String name ) { String lcName = name . toLowerCase ( ) ; for ( T item : collection ) { if ( item . getName ( ) . toLowerCase ( ) . equals ( lcName ) ) { return item ; } } return null ; }
Find for contained element using its name .
128,335
public static void javaProperty2ContentValues ( MethodSpec . Builder methodBuilder , TypeName beanClass , String beanName , ModelProperty property ) { TypeName typeName = null ; if ( property != null && property . getPropertyType ( ) != null ) { typeName = property . getPropertyType ( ) . getTypeName ( ) ; } if ( prope...
Used to convert a property of managed bean to contentValue .
128,336
public static void javaProperty2WhereCondition ( MethodSpec . Builder methodBuilder , SQLiteModelMethod method , String paramName , TypeName paramType , ModelProperty property ) { if ( property != null && property . hasTypeAdapter ( ) ) { methodBuilder . addCode ( AbstractSQLTransform . PRE_TYPE_ADAPTER_TO_STRING + "$L...
Used to convert a property of managed bean to where condition .
128,337
public static void javaMethodParam2ContentValues ( MethodSpec . Builder methodBuilder , SQLiteModelMethod method , String paramName , TypeName paramType , ModelProperty property ) { AssertKripton . assertTrueOrInvalidMethodSignException ( ! method . hasAdapterForParam ( paramName ) , method , "method's parameter '%s' c...
Used to convert a method s parameter to contentValues . It can not have a type adpter because it eventually use the one define in associated bean s attribute
128,338
public static boolean isSupportedJDKType ( TypeName typeName ) { if ( typeName . isPrimitive ( ) ) { return getPrimitiveTransform ( typeName ) != null ; } String name = typeName . toString ( ) ; if ( name . startsWith ( "java.lang" ) ) { return getLanguageTransform ( typeName ) != null ; } if ( name . startsWith ( "jav...
Checks if is supported JDK type .
128,339
public static void resetBean ( MethodSpec . Builder methodBuilder , TypeName beanClass , String beanName , ModelProperty property , String cursorName , String indexName ) { SQLTransform transform = lookup ( property . getElement ( ) . asType ( ) ) ; if ( transform == null ) { throw new IllegalArgumentException ( "Trans...
Reset bean .
128,340
public static String columnTypeAsString ( SQLProperty property ) { if ( property . columnAffinityType != null && ColumnAffinityType . AUTO != property . columnAffinityType ) { return property . columnAffinityType . toString ( ) ; } TypeName typeName = property . getPropertyType ( ) . getTypeName ( ) ; if ( property . h...
Detect column type . If column affinity is specified by annotation affinity column is used .
128,341
public Map . Entry < K , V > ceil ( K k ) { if ( contains ( k ) ) { return mHashMap . get ( k ) . mPrevious ; } return null ; }
Return an entry added to prior to an entry associated with the given key .
128,342
public static < D , J > J toJava ( Class < ? extends PreferenceTypeAdapter < J , D > > clazz , D value ) { @ SuppressWarnings ( "unchecked" ) PreferenceTypeAdapter < J , D > adapter = cache . get ( clazz ) ; if ( adapter == null ) { adapter = generateAdapter ( clazz ) ; } return adapter . toJava ( value ) ; }
To java .
128,343
public static boolean isStringSet ( PrefsProperty property ) { boolean isStringSet = false ; TypeName typeName ; if ( property . hasTypeAdapter ( ) ) { typeName = TypeUtility . typeName ( property . typeAdapter . dataType ) ; } else { typeName = TypeUtility . typeName ( property . getElement ( ) . asType ( ) ) ; } if (...
Checks if is string set .
128,344
public String getAttributeAsClassName ( AnnotationAttributeType attribute ) { String temp = attributes . get ( attribute . getValue ( ) ) ; if ( StringUtils . hasText ( temp ) ) { temp = temp . replace ( ".class" , "" ) ; } return temp ; }
Gets the attribute as class name .
128,345
public List < String > getAttributeAsArray ( AnnotationAttributeType attribute ) { String temp = attributes . get ( attribute . getValue ( ) ) ; return AnnotationUtility . extractAsArrayOfString ( temp ) ; }
Gets the attribute as array .
128,346
public int getAttributeAsInt ( AnnotationAttributeType attribute ) { String temp = attributes . get ( attribute . getValue ( ) ) ; return Integer . parseInt ( temp ) ; }
Gets the attribute as int .
128,347
protected void generateSubQueries ( Builder methodBuilder , SQLiteModelMethod method ) { SQLiteEntity entity = method . getEntity ( ) ; for ( Triple < String , String , SQLiteModelMethod > item : method . childrenSelects ) { TypeName entityTypeName = TypeUtility . typeName ( entity . getElement ( ) ) ; String setter ; ...
generate code for sub queries
128,348
public void generateCommonPart ( SQLiteModelMethod method , TypeSpec . Builder classBuilder , MethodSpec . Builder methodBuilder , Set < JQLProjection > fieldList , boolean generateSqlField ) { generateCommonPart ( method , classBuilder , methodBuilder , fieldList , GenerationType . ALL , null , generateSqlField , fals...
Generate common part .
128,349
protected MethodSpec . Builder generateMethodBuilder ( SQLiteModelMethod method ) { MethodSpec . Builder methodBuilder ; if ( method . hasLiveData ( ) ) { methodBuilder = MethodSpec . methodBuilder ( method . getName ( ) + LIVE_DATA_PREFIX ) . addModifiers ( Modifier . PROTECTED ) ; } else { methodBuilder = MethodSpec ...
Generate method builder .
128,350
protected void generateMethodSignature ( SQLiteModelMethod method , MethodSpec . Builder methodBuilder , TypeName returnTypeName , ParameterSpec ... additionalParameterSpec ) { boolean finalParameter = false ; if ( method . hasLiveData ( ) && returnTypeName . equals ( method . liveDataReturnClass ) ) { finalParameter =...
Generate method signature .
128,351
public static void checkUnusedParameters ( SQLiteModelMethod method , Set < String > usedMethodParameters , TypeName excludedClasses ) { int paramsCount = method . getParameters ( ) . size ( ) ; int usedCount = usedMethodParameters . size ( ) ; if ( paramsCount > usedCount ) { StringBuilder sb = new StringBuilder ( ) ;...
Check if there are unused method parameters . In this case an exception was throws .
128,352
private static void generateSQLBuild ( SQLiteModelMethod method , MethodSpec . Builder methodBuilder , SplittedSql splittedSql , boolean countQuery ) { methodBuilder . addStatement ( "$T _sqlBuilder=sqlBuilder()" , StringBuilder . class ) ; methodBuilder . addStatement ( "_sqlBuilder.append($S)" , splittedSql . sqlBasi...
Generate SQL build .
128,353
public static String extractClassName ( String fullName ) { int l = fullName . lastIndexOf ( "." ) ; return fullName . substring ( l + 1 ) ; }
Extract class name .
128,354
public static boolean isTypeIncludedIn ( TypeName value , Type ... types ) { for ( Type item : types ) { if ( value . equals ( typeName ( item ) ) ) { return true ; } } return false ; }
Checks if is type included in .
128,355
public static boolean isTypePrimitive ( TypeName value ) { return isTypeIncludedIn ( value , Byte . TYPE , Character . TYPE , Boolean . TYPE , Short . TYPE , Integer . TYPE , Long . TYPE , Float . TYPE , Double . TYPE ) ; }
Checks if is type primitive .
128,356
public static boolean isTypeWrappedPrimitive ( TypeName value ) { return isTypeIncludedIn ( value , Byte . class , Character . class , Boolean . class , Short . class , Integer . class , Long . class , Float . class , Double . class ) ; }
Checks if is type wrapped primitive .
128,357
public static boolean isEquals ( TypeName value , TypeName kindOfParameter ) { return value . toString ( ) . equals ( kindOfParameter . toString ( ) ) ; }
Check if class that is rapresented by value has same typeName of entity parameter .
128,358
public static TypeName typeName ( TypeMirror typeMirror ) { LiteralType literalType = LiteralType . of ( typeMirror . toString ( ) ) ; if ( literalType . isArray ( ) ) { return ArrayTypeName . of ( typeName ( literalType . getRawType ( ) ) ) ; } else if ( literalType . isCollection ( ) ) { return ParameterizedTypeName ...
Convert a TypeMirror in a typeName .
128,359
public static ClassName mergeTypeNameWithSuffix ( TypeName typeName , String typeNameSuffix ) { ClassName className = className ( typeName . toString ( ) ) ; return classNameWithSuffix ( className . packageName ( ) , className . simpleName ( ) , typeNameSuffix ) ; }
Merge type name with suffix .
128,360
public static TypeName typeName ( String typeName ) { TypeName [ ] values = { TypeName . BOOLEAN , TypeName . BYTE , TypeName . CHAR , TypeName . DOUBLE , TypeName . FLOAT , TypeName . INT , TypeName . LONG , TypeName . SHORT , TypeName . VOID } ; for ( TypeName item : values ) { if ( item . toString ( ) . equals ( typ...
Convert a TypeMirror in a typeName or classname or whatever .
128,361
public static void checkTypeCompatibility ( SQLiteModelMethod method , Pair < String , TypeName > item , ModelProperty property ) { if ( ! TypeUtility . isEquals ( item . value1 , property . getPropertyType ( ) . getTypeName ( ) ) ) { throw ( new InvalidMethodSignException ( method , String . format ( "property '%s' is...
Check if type if compatibility .
128,362
public static void beginStringConversion ( Builder methodBuilder , ModelProperty property ) { TypeName modelType = typeName ( property . getElement ( ) . asType ( ) ) ; beginStringConversion ( methodBuilder , modelType ) ; }
generate begin string to translate in code to used in content value or parameter need to be converted in string through String . valueOf
128,363
public static void endStringConversion ( Builder methodBuilder , TypeName typeMirror ) { SQLTransform transform = SQLTransformer . lookup ( typeMirror ) ; switch ( transform . getColumnType ( ) ) { case TEXT : return ; case BLOB : methodBuilder . addCode ( ",$T.UTF_8)" , StandardCharsets . class ) ; break ; case INTEGE...
generate end string to translate in code to used in content value or parameter need to be converted in string through String . valueOf
128,364
public static TypeName typeName ( TypeElement element , String suffix ) { String fullName = element . getQualifiedName ( ) . toString ( ) + suffix ; int lastIndex = fullName . lastIndexOf ( "." ) ; String packageName = fullName . substring ( 0 , lastIndex ) ; String className = fullName . substring ( lastIndex + 1 ) ; ...
Type name .
128,365
public static TypeName parameterizedTypeName ( ClassName rawClass , TypeName paramClass ) { return ParameterizedTypeName . get ( rawClass , paramClass ) ; }
Parameterized type name .
128,366
public static String simpleName ( TypeName clazzName ) { String clazz = clazzName . toString ( ) ; int index = clazz . lastIndexOf ( "." ) ; if ( index > 0 ) { clazz = clazz . substring ( index + 1 ) ; } return clazz ; }
Return simple typeName of class .
128,367
public static boolean isEnum ( String className ) { try { TypeElement element = BindTypeSubProcessor . elementUtils . getTypeElement ( className ) ; if ( element instanceof TypeElement ) { TypeElement typeElement = element ; TypeMirror superclass = typeElement . getSuperclass ( ) ; if ( superclass instanceof DeclaredTy...
Checks if is enum .
128,368
public static boolean isCollectionOfType ( TypeName typeName , TypeName elementTypeName ) { return isAssignable ( typeName , Collection . class ) && isEquals ( ( ( ParameterizedTypeName ) typeName ) . typeArguments . get ( 0 ) , elementTypeName ) ; }
Checks if is collection and if element type is the one passed as parameter .
128,369
public static boolean isAssignable ( TypeName typeName , Class < ? > assignableClazz ) { try { if ( typeName instanceof ParameterizedTypeName ) { typeName = ( ( ParameterizedTypeName ) typeName ) . rawType ; } else if ( typeName instanceof ArrayTypeName ) { typeName = ( ( ArrayTypeName ) typeName ) . componentType ; } ...
Checks if is assignable .
128,370
public static String extractPackageName ( TypeElement element ) { String fullName = element . getQualifiedName ( ) . toString ( ) ; if ( fullName . lastIndexOf ( "." ) > 0 ) { return fullName . substring ( 0 , fullName . lastIndexOf ( "." ) ) ; } return "" ; }
Extract package name .
128,371
protected < L extends JqlBaseListener > void analyzeVariableStatementInternal ( JQLContext jqlContext , final String jql , L listener ) { walker . walk ( listener , prepareVariableStatement ( jqlContext , jql ) . value0 ) ; }
Analyze variable statement internal .
128,372
protected Pair < ParserRuleContext , CommonTokenStream > prepareParser ( final JQLContext jqlContext , final String jql ) { JqlLexer lexer = new JqlLexer ( CharStreams . fromString ( jql ) ) ; CommonTokenStream tokens = new CommonTokenStream ( lexer ) ; JqlParser parser = new JqlParser ( tokens ) ; parser . removeError...
Prepare parser .
128,373
public Set < String > extractColumnsToInsertOrUpdate ( final JQLContext jqlContext , String jqlValue , final Finder < SQLProperty > entity ) { final Set < String > result = new LinkedHashSet < String > ( ) ; final One < Boolean > selectionOn = new One < Boolean > ( null ) ; final One < Boolean > insertOn = new One < Bo...
Extract columns to insert or update .
128,374
private String replaceInternal ( final JQLContext jqlContext , String jql , final List < Triple < Token , Token , String > > replace , JqlBaseListener rewriterListener ) { Pair < ParserRuleContext , CommonTokenStream > parser = prepareParser ( jqlContext , jql ) ; walker . walk ( rewriterListener , parser . value0 ) ; ...
Replace internal .
128,375
private String replaceFromVariableStatementInternal ( JQLContext context , String jql , final List < Triple < Token , Token , String > > replace , JqlBaseListener rewriterListener ) { Pair < ParserRuleContext , CommonTokenStream > parser = prepareVariableStatement ( context , jql ) ; walker . walk ( rewriterListener , ...
Replace from variable statement internal .
128,376
private < L extends Collection < JQLPlaceHolder > > L extractPlaceHolders ( final JQLContext jqlContext , String jql , final L result ) { final One < Boolean > valid = new One < > ( ) ; valid . value0 = false ; analyzeInternal ( jqlContext , jql , new JqlBaseListener ( ) { public void enterBind_parameter ( Bind_paramet...
Extract place holders .
128,377
private < L extends Collection < JQLPlaceHolder > > L extractPlaceHoldersFromVariableStatement ( final JQLContext jqlContext , String jql , final L result ) { final One < Boolean > valid = new One < > ( ) ; if ( ! StringUtils . hasText ( jql ) ) return result ; valid . value0 = false ; analyzeVariableStatementInternal ...
Extract place holders from variable statement .
128,378
void generateSerializeInternal ( BindTypeContext context , MethodSpec . Builder methodBuilder , String serializerName , TypeName beanClass , String beanName , BindProperty property , boolean onString ) { TypeName typeName = property . getPropertyType ( ) . getTypeName ( ) ; String bindName = context . getBindMapperName...
Generate serialize internal .
128,379
public static String daoName ( SQLiteDaoDefinition value ) { String classTableName = value . getName ( ) ; classTableName = classTableName + SUFFIX ; return classTableName ; }
Dao name .
128,380
static List < String > extractAsArrayOfClassName ( String value ) { Matcher matcher = classPattern . matcher ( value ) ; List < String > result = new ArrayList < String > ( ) ; while ( matcher . find ( ) ) { result . add ( matcher . group ( 1 ) ) ; } return result ; }
Extract as array of class name .
128,381
public static List < String > extractAsArrayOfString ( String value ) { Matcher matcher = arrayPattern . matcher ( value ) ; List < String > result = new ArrayList < String > ( ) ; while ( matcher . find ( ) ) { result . add ( StringEscapeUtils . unescapeEcmaScript ( matcher . group ( 1 ) ) ) ; } return result ; }
Extract as array of string .
128,382
public static void forEachAnnotations ( Element currentElement , AnnotationFilter filter , AnnotationFoundListener listener ) { final Elements elementUtils = BaseProcessor . elementUtils ; List < ? extends AnnotationMirror > annotationList = elementUtils . getAllAnnotationMirrors ( currentElement ) ; String annotationC...
Iterate over annotations of currentElement . Accept only annotation in accepted set .
128,383
static void extractString ( Elements elementUtils , Element item , Class < ? extends Annotation > annotationClass , AnnotationAttributeType attribute , OnAttributeFoundListener listener ) { extractAttributeValue ( elementUtils , item , annotationClass . getCanonicalName ( ) , attribute , listener ) ; }
Extract string .
128,384
public static List < ModelAnnotation > buildAnnotationList ( final Element element , final AnnotationFilter filter ) { final List < ModelAnnotation > annotationList = new ArrayList < > ( ) ; forEachAnnotations ( element , filter , new AnnotationFoundListener ( ) { public void onAcceptAnnotation ( Element executableMeth...
Builds the annotation list .
128,385
public static int extractAsInt ( Element item , Class < ? extends Annotation > annotationClass , AnnotationAttributeType attributeName ) { final Elements elementUtils = BaseProcessor . elementUtils ; final One < Integer > result = new One < Integer > ( ) ; result . value0 = 0 ; extractString ( elementUtils , item , ann...
Extract as int .
128,386
public static boolean extractAsBoolean ( Element item , Class < ? extends Annotation > annotationClass , AnnotationAttributeType attribute ) { final Elements elementUtils = BaseProcessor . elementUtils ; final One < Boolean > result = new One < Boolean > ( false ) ; extractString ( elementUtils , item , annotationClass...
Extract as boolean .
128,387
public static < E extends ModelEntity < ? > > boolean extractAsBoolean ( E item , ModelAnnotation annotation , AnnotationAttributeType attribute ) { final Elements elementUtils = BaseProcessor . elementUtils ; final One < Boolean > result = new One < Boolean > ( false ) ; extractAttributeValue ( elementUtils , item . g...
Estract from an annotation of a method the attribute value specified .
128,388
public static Boolean getAnnotationAttributeAsBoolean ( ModelWithAnnotation model , Class < ? extends Annotation > annotation , AnnotationAttributeType attribute , Boolean defaultValue ) { return getAnnotationAttribute ( model , annotation , attribute , defaultValue , new OnAnnotationAttributeListener < Boolean > ( ) {...
Gets the annotation attribute as boolean .
128,389
static < T > T getAnnotationAttribute ( ModelWithAnnotation model , Class < ? extends Annotation > annotation , AnnotationAttributeType attribute , T defaultValue , OnAnnotationAttributeListener < T > listener ) { String attributeResult ; ModelAnnotation item = model . getAnnotation ( annotation ) ; if ( item != null )...
Gets the annotation attribute .
128,390
public String getBindMapperName ( BindTypeContext context , TypeName typeName ) { Converter < String , String > format = CaseFormat . UPPER_CAMEL . converterTo ( CaseFormat . LOWER_CAMEL ) ; TypeName bindMapperName = TypeUtility . mergeTypeNameWithSuffix ( typeName , BindTypeBuilder . SUFFIX ) ; String simpleName = for...
Gets the bind mapper name .
128,391
public static void generateJavaDocReturnType ( MethodSpec . Builder methodBuilder , TypeName returnType ) { if ( returnType == TypeName . VOID ) { } else if ( TypeUtility . isTypeIncludedIn ( returnType , Boolean . TYPE , Boolean . class ) ) { methodBuilder . addJavadoc ( "\n" ) ; methodBuilder . addJavadoc ( "@return ...
Generate javadoc about return type of method .
128,392
static boolean modifierIsAcceptable ( Element item ) { Object [ ] values = { Modifier . NATIVE , Modifier . STATIC , Modifier . ABSTRACT } ; for ( Object i : values ) { if ( item . getModifiers ( ) . contains ( i ) ) return false ; } return true ; }
Modifier is acceptable .
128,393
public static ConflictAlgorithmType getConflictAlgorithmType ( SQLiteModelMethod method ) { ModelAnnotation annotation = method . getAnnotation ( BindSqlInsert . class ) ; String value = annotation . getAttribute ( AnnotationAttributeType . CONFLICT_ALGORITHM_TYPE ) ; if ( value != null && value . indexOf ( "." ) > - 1...
Gets the conflict algorithm type .
128,394
private boolean readln1 ( String strExpected , String strAlternative ) { String sX = scanner . next ( ) ; if ( sX . equals ( strExpected ) ) { return true ; } if ( sX . equals ( strAlternative ) ) { return false ; } throw new IllegalStateException ( "Expected: " + strAlternative + " but got: " + sX ) ; }
Reads 1 token .
128,395
public int getNextPage ( int prevPage ) { reportFreePage ( prevPage ) ; if ( iter . hasNextULL ( ) ) { LongLongIndex . LLEntry e = iter . nextULL ( ) ; long pageId = e . getKey ( ) ; long value = e . getValue ( ) ; while ( ( value > maxFreeTxId || value < 0 ) && iter . hasNextULL ( ) ) { if ( value < 0 && ( ( - value )...
Get a new free page .
128,396
public final void offer ( DataDeSerializer e ) { lock ( ) ; try { if ( count < items . length ) { items [ count ++ ] = e ; } } finally { unlock ( ) ; } }
Return an object . The object may be discarded if the pool is full .
128,397
public List < QueryAdvice > determineIndexToUse ( QueryTreeNode queryTree ) { List < QueryAdvice > advices = new LinkedList < QueryAdvice > ( ) ; List < ZooFieldDef > availableIndices = new LinkedList < ZooFieldDef > ( ) ; for ( ZooFieldDef f : clsDef . getAllFields ( ) ) { if ( f . isIndexed ( ) ) { availableIndices ....
Determine index to use .
128,398
int getPagePosition ( AbstractIndexPage indexPage ) { for ( int i = 0 ; i < subPages . length ; i ++ ) { if ( subPages [ i ] == indexPage ) { return i ; } } throw DBLogger . newFatalInternal ( "Leaf page not found in parent page: " + indexPage . pageId + " " + Arrays . toString ( subPageIds ) ) ; }
This method will fail if called on the first page in the tree . However this should not happen because when called we already have a reference to a previous page .
128,399
private void loadAllInstances ( ZooClassProxy def , boolean subClasses , MergingIterator < ZooPC > iter , boolean loadFromCache ) { for ( Node n : nodes ) { iter . add ( n . loadAllInstances ( def , loadFromCache ) ) ; } if ( subClasses ) { for ( ZooClassProxy sub : def . getSubProxies ( ) ) { loadAllInstances ( sub , ...
This method avoids nesting MergingIterators .