/** * Returns a string containing the specified number of indentations, where * each indentation contains {@link #INDENTATION} blank characters. * * * @param nIndentations the number of indentations in the returned String. * @return the String containing the specified number of indentations. */ public String generateNodePrefix(int nIndentations) { return StringHelper.repeat( ' ', nIndentations * INDENTATION ) + " - "; } }
@Override public void traceOut(String ruleName, AST tree) { if ( inputState.guessing > 0 ) { return; } String prefix = "<-" + StringHelper.repeat( '-', ( --traceDepth * 2 ) ) + " "; LOG.trace( prefix + ruleName ); }
@Override public void traceIn(String ruleName) { if ( inputState.guessing > 0 ) { return; } String prefix = StringHelper.repeat( '-', ( traceDepth++ * 2 ) ) + "-> "; LOG.trace( prefix + ruleName ); }
@Override public void traceOut(String ruleName) { if ( inputState.guessing > 0 ) { return; } String prefix = "<-" + StringHelper.repeat( '-', ( --traceDepth * 2 ) ) + " "; LOG.trace( prefix + ruleName ); }
@Override public void traceIn(String ruleName, AST tree) { if ( inputState.guessing > 0 ) { return; } String prefix = StringHelper.repeat( '-', ( traceDepth++ * 2 ) ) + "-> "; String traceText = ruleName + " (" + buildTraceNodeName( tree ) + ")"; LOG.trace( prefix + traceText ); }
public static String toBinaryString(long value) { String formatted = Long.toBinaryString( value ); StringBuilder buf = new StringBuilder( StringHelper.repeat( '0', 64 ) ); buf.replace( 64 - formatted.length(), 64, formatted ); return buf.toString(); } }
public static String toBinaryString(int value) { String formatted = Long.toBinaryString( value ); StringBuilder buf = new StringBuilder( StringHelper.repeat( '0', 32 ) ); buf.replace( 64 - formatted.length(), 64, formatted ); return buf.toString(); }
@Override public void finishingComposite(CompositionDefinition compositionDefinition) { // No need to pop anything here; it will be popped by // #finishingAttribute, #finishingCollectionElements, #finishingCollectionIndex, or #finishingEntityIdentifier log.tracef( "%s Finishing composite : %s", StringHelper.repeat( "<<", fetchSourceStack.size() ), compositionDefinition.getName() ); }
@Override public void traceOut(String ruleName, AST tree) { if ( !LOG.isTraceEnabled() ) { return; } if ( inputState.guessing > 0 ) { return; } String prefix = "<-" + StringHelper.repeat( '-', ( --traceDepth * 2 ) ) + " "; LOG.trace( prefix + ruleName ); }
@Override public void traceOut(String ruleName) { if ( !LOG.isTraceEnabled() ) { return; } if ( inputState.guessing > 0 ) { return; } String prefix = "<-" + StringHelper.repeat( '-', ( --traceDepth * 2 ) ) + " "; LOG.trace( prefix + ruleName ); }
@Override public void traceIn(String ruleName) { if ( !LOG.isTraceEnabled() ) { return; } if ( inputState.guessing > 0 ) { return; } String prefix = StringHelper.repeat( '-', ( traceDepth++ * 2 ) ) + "-> "; LOG.trace( prefix + ruleName ); }
@Override public void traceOut(String ruleName, AST tree) { if ( !LOG.isTraceEnabled() ) { return; } if ( inputState.guessing > 0 ) { return; } String prefix = "<-" + StringHelper.repeat( '-', ( --traceDepth * 2 ) ) + " "; LOG.trace( prefix + ruleName ); }
@Override public void associationKeyRegistered(AssociationKey associationKey) { // todo : use this information to maintain a map of AssociationKey->FetchSource mappings (associationKey + current FetchSource stack entry) // that mapping can then be used in #foundCircularAssociationKey to build the proper BiDirectionalEntityFetch // based on the mapped owner log.tracef( "%s Registering AssociationKey : %s -> %s", StringHelper.repeat( "..", fetchSourceStack.size() ), associationKey, currentSource() ); fetchedAssociationKeySourceMap.put( associationKey, currentSource() ); }
@Override public void traceIn(String ruleName, AST tree) { if ( !LOG.isTraceEnabled() ) { return; } if ( inputState.guessing > 0 ) { return; } String prefix = StringHelper.repeat( '-', ( traceDepth++ * 2 ) ) + "-> "; String traceText = ruleName + " (" + buildTraceNodeName( tree ) + ")"; LOG.trace( prefix + traceText ); }
@Override public void traceIn(String ruleName, AST tree) { if ( !LOG.isTraceEnabled() ) { return; } if ( inputState.guessing > 0 ) { return; } String prefix = StringHelper.repeat( '-', ( traceDepth++ * 2 ) ) + "-> "; String traceText = ruleName + " (" + buildTraceNodeName( tree ) + ")"; LOG.trace( prefix + traceText ); }
@Override public void finishingCollection(CollectionDefinition collectionDefinition) { final boolean isRoot = fetchSourceStack.isEmpty() && collectionReferenceStack.size() == 1; if ( !isRoot ) { // if not, this call should represent a fetch which will be handled in #finishingAttribute return; } final CollectionReference popped = popFromCollectionStack(); checkedPoppedCollection( popped, collectionDefinition ); log.tracef( "%s Finished root collection : %s", StringHelper.repeat( "<<", fetchSourceStack.size() ), collectionDefinition.getCollectionPersister().getRole() ); }
@Override protected void finishSubGraph() { final GraphImplementor<?> popped = graphStack.pop(); if ( PARSING_LOGGER.isDebugEnabled() ) { PARSING_LOGGER.debugf( "%s Finished graph : %s", StringHelper.repeat( "<<", attributeNodeStack.depth() + 2 ), popped.getGraphedType().getName() ); } } }
@Override protected void finishAttribute() { graphSourceStack.pop(); final AttributeNodeImplementor<?> popped = attributeNodeStack.pop(); if ( PARSING_LOGGER.isDebugEnabled() ) { PARSING_LOGGER.debugf( "%s Finished attribute : %s", StringHelper.repeat( "<<", attributeNodeStack.depth() + 1 ), popped.getAttributeDescriptor().getName() ); } }
@Override protected void startAttribute(Token attributeNameToken) { final String attributeName = attributeNameToken.getText(); if ( PARSING_LOGGER.isDebugEnabled() ) { PARSING_LOGGER.debugf( "%s Start attribute : %s", StringHelper.repeat( ">>", attributeNodeStack.depth() + 1 ), attributeName ); } final AttributeNodeImplementor attributeNode = resolveAttributeNode( attributeName ); attributeNodeStack.push( attributeNode ); graphSourceStack.push( PathQualifierType.VALUE.getSubGraphCreator() ); }
@Override protected void startQualifiedAttribute(Token attributeNameToken, Token qualifierToken) { final String attributeName = attributeNameToken.getText(); final String qualifierName = qualifierToken.getText(); if ( PARSING_LOGGER.isDebugEnabled() ) { PARSING_LOGGER.debugf( "%s Start qualified attribute : %s.%s", StringHelper.repeat( ">>", attributeNodeStack.depth() + 1 ), attributeName, qualifierName ); } final AttributeNodeImplementor<?> attributeNode = resolveAttributeNode( attributeName ); attributeNodeStack.push( attributeNode ); final PathQualifierType pathQualifierType = resolvePathQualifier( qualifierName ); graphSourceStack.push( pathQualifierType.getSubGraphCreator() ); }