idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
25,400
protected String getFacebookGraphVideoEndpointUrl ( ) { if ( apiVersion . isUrlElementRequired ( ) ) { return getFacebookEndpointUrls ( ) . getGraphVideoEndpoint ( ) + ' ' + apiVersion . getUrlElement ( ) ; } else { return getFacebookEndpointUrls ( ) . getGraphVideoEndpoint ( ) ; } }
Returns the base endpoint URL for the Graph API s video upload functionality .
78
14
25,401
public Double getDoubleFrom ( JsonValue json ) { if ( json . isNumber ( ) ) { return json . asDouble ( ) ; } else { return Double . valueOf ( json . asString ( ) ) ; } }
convert jsonvalue to a Double
49
7
25,402
public Integer getIntegerFrom ( JsonValue json ) { if ( json . isNumber ( ) ) { return json . asInt ( ) ; } else { return Integer . valueOf ( json . asString ( ) ) ; } }
convert jsonvalue to a Integer
49
7
25,403
public String getStringFrom ( JsonValue json ) { if ( json . isString ( ) ) { return json . asString ( ) ; } else { return json . toString ( ) ; } }
convert jsonvalue to a String
43
7
25,404
public Float getFloatFrom ( JsonValue json ) { if ( json . isNumber ( ) ) { return json . asFloat ( ) ; } else { return new BigDecimal ( json . asString ( ) ) . floatValue ( ) ; } }
convert jsonvalue to a Float
54
7
25,405
public BigInteger getBigIntegerFrom ( JsonValue json ) { if ( json . isString ( ) ) { return new BigInteger ( json . asString ( ) ) ; } else { return new BigInteger ( json . toString ( ) ) ; } }
convert jsonvalue to a BigInteger
55
8
25,406
public Long getLongFrom ( JsonValue json ) { if ( json . isNumber ( ) ) { return json . asLong ( ) ; } else { return Long . valueOf ( json . asString ( ) ) ; } }
convert jsonvalue to a Long
49
7
25,407
public BigDecimal getBigDecimalFrom ( JsonValue json ) { if ( json . isString ( ) ) { return new BigDecimal ( json . asString ( ) ) ; } else { return new BigDecimal ( json . toString ( ) ) ; } }
convert jsonvalue to a BigDecimal
59
9
25,408
private void fillTotalCount ( JsonObject summary ) { if ( totalCount == 0 && summary != null && summary . get ( "total_count" ) != null ) { totalCount = summary . getLong ( "total_count" , totalCount ) ; } }
add change count value if summary is set and count is empty
57
12
25,409
protected String createFormFieldName ( BinaryAttachment binaryAttachment ) { if ( binaryAttachment . getFieldName ( ) != null ) { return binaryAttachment . getFieldName ( ) ; } String name = binaryAttachment . getFilename ( ) ; int fileExtensionIndex = name . lastIndexOf ( ' ' ) ; return fileExtensionIndex > 0 ? name . substring ( 0 , fileExtensionIndex ) : name ; }
Creates the form field name for the binary attachment filename by stripping off the file extension - for example the filename test . png would return test .
94
30
25,410
public InnerMessagingItem getItem ( ) { if ( optin != null ) { return optin ; } if ( postback != null ) { return postback ; } if ( delivery != null ) { return delivery ; } if ( read != null ) { return read ; } if ( accountLinking != null ) { return accountLinking ; } if ( message != null ) { return message ; } if ( checkoutUpdate != null ) { return checkoutUpdate ; } if ( payment != null ) { return payment ; } if ( referral != null ) { return referral ; } if ( policyEnforcement != null ) { return policyEnforcement ; } if ( passThreadControl != null ) { return passThreadControl ; } if ( takeThreadControl != null ) { return takeThreadControl ; } if ( requestThreadControl != null ) { return requestThreadControl ; } if ( appRoles != null ) { return appRoles ; } return null ; }
generic access to the inner item .
198
7
25,411
public List < String > getRoles ( String appId ) { if ( roles . containsKey ( appId ) ) { return Collections . unmodifiableList ( roles . get ( appId ) ) ; } else { return null ; } }
get the roles to the given app id
51
8
25,412
protected void skipResponseStatusExceptionParsing ( String json ) throws ResponseErrorJsonParsingException { // If this is not an object, it's not an error response. if ( ! json . startsWith ( "{" ) ) { throw new ResponseErrorJsonParsingException ( ) ; } int subStrEnd = Math . min ( 50 , json . length ( ) ) ; if ( ! json . substring ( 0 , subStrEnd ) . contains ( "\"error\"" ) ) { throw new ResponseErrorJsonParsingException ( ) ; } }
checks if a string may be a json and contains a error string somewhere this is used for speedup the error parsing
123
23
25,413
public InputStream getData ( ) { if ( data != null ) { return new ByteArrayInputStream ( data ) ; } else if ( dataStream != null ) { return dataStream ; } else { throw new IllegalStateException ( "Either the byte[] or the stream mustn't be null at this point." ) ; } }
The attachment s data .
69
5
25,414
public String getContentType ( ) { if ( contentType != null ) { return contentType ; } if ( dataStream != null ) { try { contentType = URLConnection . guessContentTypeFromStream ( dataStream ) ; } catch ( IOException ioe ) { // ignore exception } } if ( data != null ) { contentType = URLConnection . guessContentTypeFromName ( filename ) ; } // fallback - if we have no contenttype and cannot detect one, use 'application/octet-stream' if ( contentType == null ) { contentType = "application/octet-stream" ; } return contentType ; }
return the given content type or try to guess from stream or file name . Depending of the available data .
134
21
25,415
protected void logMultipleMappingFailedForField ( String facebookFieldName , FieldWithAnnotation < Facebook > fieldWithAnnotation , String json ) { if ( ! MAPPER_LOGGER . isTraceEnabled ( ) ) { return ; } Field field = fieldWithAnnotation . getField ( ) ; MAPPER_LOGGER . trace ( "Could not map '{}' to {}. {}, but continuing on because '{}" + "' is mapped to multiple fields in {}. JSON is {}" , facebookFieldName , field . getDeclaringClass ( ) . getSimpleName ( ) , field . getName ( ) , facebookFieldName , field . getDeclaringClass ( ) . getSimpleName ( ) , json ) ; }
Dumps out a log message when one of a multiple - mapped Facebook field name JSON - to - Java mapping operation fails .
157
25
25,416
protected Set < String > facebookFieldNamesWithMultipleMappings ( List < FieldWithAnnotation < Facebook > > fieldsWithAnnotation ) { Map < String , Integer > facebookFieldsNamesWithOccurrenceCount = new HashMap <> ( ) ; Set < String > facebookFieldNamesWithMultipleMappings = new HashSet <> ( ) ; // Get a count of Facebook field name occurrences for each // @Facebook-annotated field for ( FieldWithAnnotation < Facebook > fieldWithAnnotation : fieldsWithAnnotation ) { String fieldName = getFacebookFieldName ( fieldWithAnnotation ) ; int occurrenceCount = facebookFieldsNamesWithOccurrenceCount . containsKey ( fieldName ) ? facebookFieldsNamesWithOccurrenceCount . get ( fieldName ) : 0 ; facebookFieldsNamesWithOccurrenceCount . put ( fieldName , occurrenceCount + 1 ) ; } // Pull out only those field names with multiple mappings for ( Entry < String , Integer > entry : facebookFieldsNamesWithOccurrenceCount . entrySet ( ) ) { if ( entry . getValue ( ) > 1 ) { facebookFieldNamesWithMultipleMappings . add ( entry . getKey ( ) ) ; } } return unmodifiableSet ( facebookFieldNamesWithMultipleMappings ) ; }
Finds any Facebook JSON fields that are mapped to more than 1 Java field .
267
16
25,417
public static boolean isEmptyCollectionOrMap ( Object obj ) { if ( obj instanceof Collection ) { return ( ( Collection ) obj ) . isEmpty ( ) ; } return ( obj instanceof Map && ( ( Map ) obj ) . isEmpty ( ) ) ; }
Checks is the object is a empty collection or map .
56
12
25,418
public static RestFBLogger getLoggerInstance ( String logCategory ) { Object obj ; Class [ ] ctrTypes = new Class [ ] { String . class } ; Object [ ] ctrArgs = new Object [ ] { logCategory } ; try { Constructor loggerClassConstructor = usedLoggerClass . getConstructor ( ctrTypes ) ; obj = loggerClassConstructor . newInstance ( ctrArgs ) ; } catch ( Exception e ) { throw new FacebookLoggerException ( "cannot create logger: " + logCategory ) ; } return ( RestFBLogger ) obj ; }
returns the instance of the logger that belongs to the category .
129
13
25,419
private void updateList ( final File filename ) { try { final URI reletivePath = toURI ( filename . getAbsolutePath ( ) . substring ( new File ( normalize ( tempDir . toString ( ) ) ) . getPath ( ) . length ( ) + 1 ) ) ; final FileInfo f = job . getOrCreateFileInfo ( reletivePath ) ; if ( hasConref ) { f . hasConref = true ; } if ( hasKeyref ) { f . hasKeyref = true ; } job . write ( ) ; } catch ( final RuntimeException e ) { throw e ; } catch ( final Exception e ) { logger . error ( e . getMessage ( ) , e ) ; } }
Update conref list in job configuration and in conref list file .
156
14
25,420
public void addPlugins ( final String s ) { final StringTokenizer t = new StringTokenizer ( s , REQUIREMENT_SEPARATOR ) ; while ( t . hasMoreTokens ( ) ) { plugins . add ( t . nextToken ( ) ) ; } }
Add plugins .
58
3
25,421
private void refineAction ( final Action action , final FilterKey key ) { if ( key . value != null && bindingMap != null && ! bindingMap . isEmpty ( ) ) { final Map < String , Set < Element > > schemeMap = bindingMap . get ( key . attribute ) ; if ( schemeMap != null && ! schemeMap . isEmpty ( ) ) { for ( final Set < Element > submap : schemeMap . values ( ) ) { for ( final Element e : submap ) { final Element subRoot = searchForKey ( e , key . value ) ; if ( subRoot != null ) { insertAction ( subRoot , key . attribute , action ) ; } } } } } }
Refine action key with information from subject schemes .
149
10
25,422
private void insertAction ( final Element subTree , final QName attName , final Action action ) { if ( subTree == null || action == null ) { return ; } final LinkedList < Element > queue = new LinkedList <> ( ) ; // Skip the sub-tree root because it has been added already. NodeList children = subTree . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { if ( children . item ( i ) . getNodeType ( ) == Node . ELEMENT_NODE ) { queue . offer ( ( Element ) children . item ( i ) ) ; } } while ( ! queue . isEmpty ( ) ) { final Element node = queue . poll ( ) ; children = node . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { if ( children . item ( i ) . getNodeType ( ) == Node . ELEMENT_NODE ) { queue . offer ( ( Element ) children . item ( i ) ) ; } } if ( SUBJECTSCHEME_SUBJECTDEF . matches ( node ) ) { final String key = node . getAttribute ( ATTRIBUTE_NAME_KEYS ) ; if ( key != null && ! key . trim ( ) . isEmpty ( ) ) { final FilterKey k = new FilterKey ( attName , key ) ; if ( ! filterMap . containsKey ( k ) ) { filterMap . put ( k , action ) ; } } } } }
Insert subject scheme based action into filetermap if key not present in the map
339
16
25,423
private Element searchForKey ( final Element root , final String keyValue ) { if ( root == null || keyValue == null ) { return null ; } final LinkedList < Element > queue = new LinkedList <> ( ) ; queue . add ( root ) ; while ( ! queue . isEmpty ( ) ) { final Element node = queue . removeFirst ( ) ; final NodeList children = node . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { if ( children . item ( i ) . getNodeType ( ) == Node . ELEMENT_NODE ) { queue . add ( ( Element ) children . item ( i ) ) ; } } if ( SUBJECTSCHEME_SUBJECTDEF . matches ( node ) ) { final String key = node . getAttribute ( ATTRIBUTE_NAME_KEYS ) ; if ( keyValue . equals ( key ) ) { return node ; } } } return null ; }
Search subject scheme elements for a given key
216
8
25,424
private void insertAction ( final Action action , final FilterKey key ) { if ( filterMap . get ( key ) == null ) { filterMap . put ( key , action ) ; } else { logger . info ( MessageUtils . getMessage ( "DOTJ007I" , key . toString ( ) ) . toString ( ) ) ; } }
Insert action into filetermap if key not present in the map
76
13
25,425
private void outputSubjectScheme ( ) throws DITAOTException { try { final Map < URI , Set < URI > > graph = SubjectSchemeReader . readMapFromXML ( new File ( job . tempDir , FILE_NAME_SUBJECT_RELATION ) ) ; final Queue < URI > queue = new LinkedList <> ( graph . keySet ( ) ) ; final Set < URI > visitedSet = new HashSet <> ( ) ; final DocumentBuilder builder = XMLUtils . getDocumentBuilder ( ) ; builder . setEntityResolver ( CatalogUtils . getCatalogResolver ( ) ) ; while ( ! queue . isEmpty ( ) ) { final URI parent = queue . poll ( ) ; final Set < URI > children = graph . get ( parent ) ; if ( children != null ) { queue . addAll ( children ) ; } if ( ROOT_URI . equals ( parent ) || visitedSet . contains ( parent ) ) { continue ; } visitedSet . add ( parent ) ; final File tmprel = new File ( FileUtils . resolve ( job . tempDir , parent ) + SUBJECT_SCHEME_EXTENSION ) ; final Document parentRoot ; if ( ! tmprel . exists ( ) ) { final URI src = job . getFileInfo ( parent ) . src ; parentRoot = builder . parse ( src . toString ( ) ) ; } else { parentRoot = builder . parse ( tmprel ) ; } if ( children != null ) { for ( final URI childpath : children ) { final Document childRoot = builder . parse ( job . getInputFile ( ) . resolve ( childpath . getPath ( ) ) . toString ( ) ) ; mergeScheme ( parentRoot , childRoot ) ; generateScheme ( new File ( job . tempDir , childpath . getPath ( ) + SUBJECT_SCHEME_EXTENSION ) , childRoot ) ; } } //Output parent scheme generateScheme ( new File ( job . tempDir , parent . getPath ( ) + SUBJECT_SCHEME_EXTENSION ) , parentRoot ) ; } } catch ( final RuntimeException e ) { throw e ; } catch ( final Exception e ) { logger . error ( e . getMessage ( ) , e ) ; throw new DITAOTException ( e ) ; } }
Output subject schema file .
502
5
25,426
private void generateScheme ( final File filename , final Document root ) throws DITAOTException { final File p = filename . getParentFile ( ) ; if ( ! p . exists ( ) && ! p . mkdirs ( ) ) { throw new DITAOTException ( "Failed to make directory " + p . getAbsolutePath ( ) ) ; } Result res = null ; try { res = new StreamResult ( new FileOutputStream ( filename ) ) ; final DOMSource ds = new DOMSource ( root ) ; final TransformerFactory tff = TransformerFactory . newInstance ( ) ; final Transformer tf = tff . newTransformer ( ) ; tf . transform ( ds , res ) ; } catch ( final RuntimeException e ) { throw e ; } catch ( final Exception e ) { logger . error ( e . getMessage ( ) , e ) ; throw new DITAOTException ( e ) ; } finally { try { close ( res ) ; } catch ( IOException e ) { throw new DITAOTException ( e ) ; } } }
Serialize subject scheme file .
231
6
25,427
public static File getPathtoProject ( final File filename , final File traceFilename , final File inputMap , final Job job ) { if ( job . getGeneratecopyouter ( ) != Job . Generate . OLDSOLUTION ) { if ( isOutFile ( traceFilename , inputMap ) ) { return toFile ( getRelativePathFromOut ( traceFilename . getAbsoluteFile ( ) , job ) ) ; } else { return getRelativePath ( traceFilename . getAbsoluteFile ( ) , inputMap . getAbsoluteFile ( ) ) . getParentFile ( ) ; } } else { return FileUtils . getRelativePath ( filename ) ; } }
Get path to base directory
145
5
25,428
private static String getRelativePathFromOut ( final File overflowingFile , final Job job ) { final URI relativePath = URLUtils . getRelativePath ( job . getInputFile ( ) , overflowingFile . toURI ( ) ) ; final File outputDir = job . getOutputDir ( ) . getAbsoluteFile ( ) ; final File outputPathName = new File ( outputDir , "index.html" ) ; final File finalOutFilePathName = resolve ( outputDir , relativePath . getPath ( ) ) ; final File finalRelativePathName = FileUtils . getRelativePath ( finalOutFilePathName , outputPathName ) ; File parentDir = finalRelativePathName . getParentFile ( ) ; if ( parentDir == null || parentDir . getPath ( ) . isEmpty ( ) ) { parentDir = new File ( "." ) ; } return parentDir . getPath ( ) + File . separator ; }
Just for the overflowing files .
203
6
25,429
@ Override public AbstractPipelineOutput execute ( final AbstractPipelineInput input ) throws DITAOTException { final Collection < FileInfo > fis = job . getFileInfo ( fi -> fi . isInput ) ; if ( ! fis . isEmpty ( ) ) { final Map < URI , Map < String , Element > > mapSet = getMapMetadata ( fis ) ; pushMetadata ( mapSet ) ; pullTopicMetadata ( input , fis ) ; } return null ; }
Entry point of MoveMetaModule .
109
7
25,430
private void pushMetadata ( final Map < URI , Map < String , Element > > mapSet ) { if ( ! mapSet . isEmpty ( ) ) { //process map first final DitaMapMetaWriter mapInserter = new DitaMapMetaWriter ( ) ; mapInserter . setLogger ( logger ) ; mapInserter . setJob ( job ) ; for ( final Entry < URI , Map < String , Element > > entry : mapSet . entrySet ( ) ) { final URI key = stripFragment ( entry . getKey ( ) ) ; final FileInfo fi = job . getFileInfo ( key ) ; if ( fi == null ) { logger . error ( "File " + new File ( job . tempDir , key . getPath ( ) ) + " was not found." ) ; continue ; } final URI targetFileName = job . tempDirURI . resolve ( fi . uri ) ; assert targetFileName . isAbsolute ( ) ; if ( fi . format != null && ATTR_FORMAT_VALUE_DITAMAP . equals ( fi . format ) ) { mapInserter . setMetaTable ( entry . getValue ( ) ) ; if ( toFile ( targetFileName ) . exists ( ) ) { logger . info ( "Processing " + targetFileName ) ; mapInserter . read ( toFile ( targetFileName ) ) ; } else { logger . error ( "File " + targetFileName + " does not exist" ) ; } } } //process topic final DitaMetaWriter topicInserter = new DitaMetaWriter ( ) ; topicInserter . setLogger ( logger ) ; topicInserter . setJob ( job ) ; for ( final Entry < URI , Map < String , Element > > entry : mapSet . entrySet ( ) ) { final URI key = stripFragment ( entry . getKey ( ) ) ; final FileInfo fi = job . getFileInfo ( key ) ; if ( fi == null ) { logger . error ( "File " + new File ( job . tempDir , key . getPath ( ) ) + " was not found." ) ; continue ; } final URI targetFileName = job . tempDirURI . resolve ( fi . uri ) ; assert targetFileName . isAbsolute ( ) ; if ( fi . format == null || fi . format . equals ( ATTR_FORMAT_VALUE_DITA ) ) { final String topicid = entry . getKey ( ) . getFragment ( ) ; topicInserter . setTopicId ( topicid ) ; topicInserter . setMetaTable ( entry . getValue ( ) ) ; if ( toFile ( targetFileName ) . exists ( ) ) { topicInserter . read ( toFile ( targetFileName ) ) ; } else { logger . error ( "File " + targetFileName + " does not exist" ) ; } } } } }
Push information from topicmeta in the map into the corresponding topics and maps .
627
15
25,431
private Map < URI , Map < String , Element > > getMapMetadata ( final Collection < FileInfo > fis ) { final MapMetaReader metaReader = new MapMetaReader ( ) ; metaReader . setLogger ( logger ) ; metaReader . setJob ( job ) ; for ( final FileInfo f : fis ) { final File mapFile = new File ( job . tempDir , f . file . getPath ( ) ) ; //FIXME: this reader gets the parent path of input file metaReader . read ( mapFile ) ; } return metaReader . getMapping ( ) ; }
Read metadata from topicmeta elements in maps .
128
9
25,432
private URI getRelativePath ( final URI href ) { final URI keyValue ; final URI inputMap = job . getFileInfo ( fi -> fi . isInput ) . stream ( ) . map ( fi -> fi . uri ) . findFirst ( ) . orElse ( null ) ; if ( inputMap != null ) { final URI tmpMap = job . tempDirURI . resolve ( inputMap ) ; keyValue = tmpMap . resolve ( stripFragment ( href ) ) ; } else { keyValue = job . tempDirURI . resolve ( stripFragment ( href ) ) ; } return URLUtils . getRelativePath ( currentFile , keyValue ) ; }
Update href URI .
143
4
25,433
private void setActiveProjectProperty ( final String propertyName , final String propertyValue ) { final Project activeProject = getProject ( ) ; if ( activeProject != null ) { activeProject . setProperty ( propertyName , propertyValue ) ; } }
Sets property in active ant project with name specified inpropertyName and value specified in propertyValue parameter
51
20
25,434
private String [ ] readParamValues ( ) throws BuildException { final ArrayList < String > prop = new ArrayList <> ( ) ; for ( final ParamElem p : params ) { if ( ! p . isValid ( ) ) { throw new BuildException ( "Incomplete parameter" ) ; } if ( isValid ( getProject ( ) , getLocation ( ) , p . getIf ( ) , p . getUnless ( ) ) ) { final int idx = Integer . parseInt ( p . getName ( ) ) - 1 ; if ( idx >= prop . size ( ) ) { prop . ensureCapacity ( idx + 1 ) ; while ( prop . size ( ) < idx + 1 ) { prop . add ( null ) ; } } prop . set ( idx , p . getValue ( ) ) ; } } return prop . toArray ( new String [ 0 ] ) ; }
Read parameter values to an array .
193
7
25,435
@ Override public String getIndexFileName ( final String outputFileRoot ) { final File indexDir = new File ( outputFileRoot ) . getParentFile ( ) ; setFilePath ( indexDir . getAbsolutePath ( ) ) ; return new File ( indexDir , "index.xml" ) . getAbsolutePath ( ) ; }
Get index file name .
73
5
25,436
@ Deprecated public void setDitadir ( final File ditaDir ) { if ( ! ditaDir . isAbsolute ( ) ) { throw new IllegalArgumentException ( "ditadir attribute value must be an absolute path: " + ditaDir ) ; } this . ditaDir = ditaDir ; }
Set the ditaDir .
70
6
25,437
private Element getTopicDoc ( final URI absolutePathToFile ) { final DocumentBuilder builder = getDocumentBuilder ( ) ; try { final Document doc = builder . parse ( absolutePathToFile . toString ( ) ) ; return doc . getDocumentElement ( ) ; } catch ( final SAXException | IOException e ) { logger . error ( "Failed to parse " + absolutePathToFile + ": " + e . getMessage ( ) , e ) ; } return null ; }
get the document node of a topic file .
103
9
25,438
public void addSubTerm ( final IndexTerm term ) { int i = 0 ; final int subTermNum = subTerms . size ( ) ; if ( IndexTermPrefix . SEE != term . getTermPrefix ( ) && IndexTermPrefix . SEE_ALSO != term . getTermPrefix ( ) ) { //if the term is not "index-see" or "index-see-also" leaf = false ; } for ( ; i < subTermNum ; i ++ ) { final IndexTerm subTerm = subTerms . get ( i ) ; if ( subTerm . equals ( term ) ) { return ; } // Add targets when same term name and same term key if ( subTerm . getTermFullName ( ) . equals ( term . getTermFullName ( ) ) && subTerm . getTermKey ( ) . equals ( term . getTermKey ( ) ) ) { subTerm . addTargets ( term . getTargetList ( ) ) ; subTerm . addSubTerms ( term . getSubTerms ( ) ) ; return ; } } if ( i == subTermNum ) { subTerms . add ( term ) ; } }
Add a sub term into the sub term list .
250
10
25,439
public void addSubTerms ( final List < IndexTerm > terms ) { int subTermsNum ; if ( terms == null ) { return ; } subTermsNum = terms . size ( ) ; for ( int i = 0 ; i < subTermsNum ; i ++ ) { addSubTerm ( terms . get ( i ) ) ; } }
Add all the sub terms in the list .
75
9
25,440
public void sortSubTerms ( ) { final int subTermNum = subTerms . size ( ) ; if ( subTerms != null && subTermNum > 0 ) { Collections . sort ( subTerms ) ; for ( final IndexTerm subTerm : subTerms ) { subTerm . sortSubTerms ( ) ; } } }
Sort all the subterms iteratively .
73
8
25,441
@ Override public int compareTo ( final IndexTerm obj ) { return DITAOTCollator . getInstance ( termLocale ) . compare ( termKey , obj . getTermKey ( ) ) ; }
Compare the given indexterm with current term .
45
9
25,442
public void addTargets ( final List < IndexTermTarget > targets ) { int targetNum ; if ( targets == null ) { return ; } targetNum = targets . size ( ) ; for ( int i = 0 ; i < targetNum ; i ++ ) { addTarget ( targets . get ( i ) ) ; } }
Add all the indexterm targets in the list .
69
10
25,443
public String getTermFullName ( ) { if ( termPrefix == null ) { return termName ; } else { if ( termLocale == null ) { return termPrefix . message + STRING_BLANK + termName ; } else { final String key = "IndexTerm." + termPrefix . message . toLowerCase ( ) . trim ( ) . replace ( ' ' , ' ' ) ; final String msg = Messages . getString ( key , termLocale ) ; if ( rtlLocaleList . contains ( termLocale . toString ( ) ) ) { return termName + STRING_BLANK + msg ; } else { return msg + STRING_BLANK + termName ; } } } }
Get the full term with any prefix .
155
8
25,444
public void updateSubTerm ( ) { if ( subTerms . size ( ) == 1 ) { // if there is only one subterm, it is necessary to update final IndexTerm term = subTerms . get ( 0 ) ; // get the only subterm if ( term . getTermPrefix ( ) == IndexTermPrefix . SEE ) { //if the only subterm is index-see update it to index-see-also term . setTermPrefix ( IndexTermPrefix . SEE_ALSO ) ; } // subTerms.set(0, term); } }
Update the sub - term prefix from See also to See if there is only one sub - term .
124
20
25,445
public void read ( final URI filename , final Document doc ) { currentFile = filename ; rootScope = null ; // TODO: use KeyScope implementation that retains order KeyScope keyScope = readScopes ( doc ) ; keyScope = cascadeChildKeys ( keyScope ) ; // TODO: determine effective key definitions here keyScope = inheritParentKeys ( keyScope ) ; rootScope = resolveIntermediate ( keyScope ) ; }
Read key definitions
89
3
25,446
private KeyScope readScopes ( final Document doc ) { final List < KeyScope > scopes = readScopes ( doc . getDocumentElement ( ) ) ; if ( scopes . size ( ) == 1 && scopes . get ( 0 ) . name == null ) { return scopes . get ( 0 ) ; } else { return new KeyScope ( "#root" , null , Collections . emptyMap ( ) , scopes ) ; } }
Read keys scopes in map .
94
7
25,447
private void readScope ( final Element scope , final Map < String , KeyDef > keyDefs ) { final List < Element > maps = new ArrayList <> ( ) ; maps . add ( scope ) ; for ( final Element child : getChildElements ( scope ) ) { collectMaps ( child , maps ) ; } for ( final Element map : maps ) { readMap ( map , keyDefs ) ; } }
Read key definitions from a key scope .
89
8
25,448
private void readMap ( final Element map , final Map < String , KeyDef > keyDefs ) { readKeyDefinition ( map , keyDefs ) ; for ( final Element elem : getChildElements ( map ) ) { if ( ! ( SUBMAP . matches ( elem ) || elem . getAttributeNode ( ATTRIBUTE_NAME_KEYSCOPE ) != null ) ) { readMap ( elem , keyDefs ) ; } } }
Recursively read key definitions from a single map fragment .
99
12
25,449
private KeyScope cascadeChildKeys ( final KeyScope rootScope ) { final Map < String , KeyDef > res = new HashMap <> ( rootScope . keyDefinition ) ; cascadeChildKeys ( rootScope , res , "" ) ; return new KeyScope ( rootScope . id , rootScope . name , res , new ArrayList <> ( rootScope . childScopes ) ) ; }
Cascade child keys with prefixes to parent key scopes .
82
13
25,450
private KeyScope resolveIntermediate ( final KeyScope scope ) { final Map < String , KeyDef > keys = new HashMap <> ( scope . keyDefinition ) ; for ( final Map . Entry < String , KeyDef > e : scope . keyDefinition . entrySet ( ) ) { final KeyDef res = resolveIntermediate ( scope , e . getValue ( ) , Collections . singletonList ( e . getValue ( ) ) ) ; keys . put ( e . getKey ( ) , res ) ; } final List < KeyScope > children = new ArrayList <> ( ) ; for ( final KeyScope child : scope . childScopes ) { final KeyScope resolvedChild = resolveIntermediate ( child ) ; children . add ( resolvedChild ) ; } return new KeyScope ( scope . id , scope . name , keys , children ) ; }
Resolve intermediate key references .
179
6
25,451
private DocumentFragment replaceContent ( final DocumentFragment pushcontent ) { final NodeList children = pushcontent . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { final Node child = children . item ( i ) ; switch ( child . getNodeType ( ) ) { case Node . ELEMENT_NODE : final Element e = ( Element ) child ; replaceLinkAttributes ( e ) ; final NodeList elements = e . getElementsByTagName ( "*" ) ; for ( int j = 0 ; i < elements . getLength ( ) ; i ++ ) { replaceLinkAttributes ( ( Element ) elements . item ( j ) ) ; } break ; } } return pushcontent ; }
Rewrite link attributes .
161
5
25,452
private boolean needPushTerm ( ) { if ( elementStack . empty ( ) ) { return false ; } if ( elementStack . peek ( ) instanceof TopicrefElement ) { // for dita files the indexterm has been moved to its <prolog> // therefore we don't need to collect these terms again. final TopicrefElement elem = ( TopicrefElement ) elementStack . peek ( ) ; if ( indexMoved && ( elem . getFormat ( ) == null || elem . getFormat ( ) . equals ( ATTR_FORMAT_VALUE_DITA ) || elem . getFormat ( ) . equals ( ATTR_FORMAT_VALUE_DITAMAP ) ) ) { return false ; } } return true ; }
Check element stack for the root topicref or indexterm element .
158
13
25,453
public boolean matches ( final Node node ) { if ( node . getNodeType ( ) == Node . ELEMENT_NODE ) { return matches ( ( ( Element ) node ) . getAttribute ( ATTRIBUTE_NAME_CLASS ) ) ; } return false ; }
Test if given DITA class string matches this DITA class .
57
15
25,454
@ Override public AbstractPipelineOutput execute ( final AbstractPipelineInput input ) throws DITAOTException { if ( fileInfoFilter == null ) { fileInfoFilter = f -> f . format == null || f . format . equals ( ATTR_FORMAT_VALUE_DITA ) || f . format . equals ( ATTR_FORMAT_VALUE_DITAMAP ) ; } final Collection < FileInfo > fis = job . getFileInfo ( fileInfoFilter ) . stream ( ) . filter ( f -> f . hasKeyref ) . collect ( Collectors . toSet ( ) ) ; if ( ! fis . isEmpty ( ) ) { try { final String cls = Optional . ofNullable ( job . getProperty ( "temp-file-name-scheme" ) ) . orElse ( configuration . get ( "temp-file-name-scheme" ) ) ; tempFileNameScheme = ( GenMapAndTopicListModule . TempFileNameScheme ) Class . forName ( cls ) . newInstance ( ) ; } catch ( InstantiationException | IllegalAccessException | ClassNotFoundException e ) { throw new RuntimeException ( e ) ; } tempFileNameScheme . setBaseDir ( job . getInputDir ( ) ) ; initFilters ( ) ; final Document doc = readMap ( ) ; final KeyrefReader reader = new KeyrefReader ( ) ; reader . setLogger ( logger ) ; final Job . FileInfo in = job . getFileInfo ( fi -> fi . isInput ) . iterator ( ) . next ( ) ; final URI mapFile = in . uri ; logger . info ( "Reading " + job . tempDirURI . resolve ( mapFile ) . toString ( ) ) ; reader . read ( job . tempDirURI . resolve ( mapFile ) , doc ) ; final KeyScope rootScope = reader . getKeyDefinition ( ) ; final List < ResolveTask > jobs = collectProcessingTopics ( fis , rootScope , doc ) ; writeMap ( doc ) ; transtype = input . getAttribute ( ANT_INVOKER_EXT_PARAM_TRANSTYPE ) ; delayConrefUtils = transtype . equals ( INDEX_TYPE_ECLIPSEHELP ) ? new DelayConrefUtils ( ) : null ; for ( final ResolveTask r : jobs ) { if ( r . out != null ) { processFile ( r ) ; } } for ( final ResolveTask r : jobs ) { if ( r . out == null ) { processFile ( r ) ; } } // Store job configuration updates for ( final URI file : normalProcessingRole ) { final FileInfo f = job . getFileInfo ( file ) ; if ( f != null ) { f . isResourceOnly = false ; job . add ( f ) ; } } try { job . write ( ) ; } catch ( final IOException e ) { throw new DITAOTException ( "Failed to store job state: " + e . getMessage ( ) , e ) ; } } return null ; }
Entry point of KeyrefModule .
667
7
25,455
private List < ResolveTask > collectProcessingTopics ( final Collection < FileInfo > fis , final KeyScope rootScope , final Document doc ) { final List < ResolveTask > res = new ArrayList <> ( ) ; final FileInfo input = job . getFileInfo ( fi -> fi . isInput ) . iterator ( ) . next ( ) ; res . add ( new ResolveTask ( rootScope , input , null ) ) ; // Collect topics from map and rewrite topicrefs for duplicates walkMap ( doc . getDocumentElement ( ) , rootScope , res ) ; // Collect topics not in map and map itself for ( final FileInfo f : fis ) { if ( ! usage . containsKey ( f . uri ) ) { res . add ( processTopic ( f , rootScope , f . isResourceOnly ) ) ; } } final List < ResolveTask > deduped = removeDuplicateResolveTargets ( res ) ; if ( fileInfoFilter != null ) { return adjustResourceRenames ( deduped . stream ( ) . filter ( rs -> fileInfoFilter . test ( rs . in ) ) . collect ( Collectors . toList ( ) ) ) ; } else { return adjustResourceRenames ( deduped ) ; } }
Collect topics for key reference processing and modify map to reflect new file names .
272
15
25,456
private List < ResolveTask > removeDuplicateResolveTargets ( List < ResolveTask > renames ) { return renames . stream ( ) . collect ( Collectors . groupingBy ( rt -> rt . scope , Collectors . toMap ( rt -> rt . in . uri , Function . identity ( ) , ( rt1 , rt2 ) -> rt1 ) ) ) . values ( ) . stream ( ) . flatMap ( m -> m . values ( ) . stream ( ) ) . collect ( Collectors . toList ( ) ) ; }
Remove duplicate sources within the same scope
127
7
25,457
List < ResolveTask > adjustResourceRenames ( final List < ResolveTask > renames ) { final Map < KeyScope , List < ResolveTask > > scopes = renames . stream ( ) . collect ( Collectors . groupingBy ( rt -> rt . scope ) ) ; final List < ResolveTask > res = new ArrayList <> ( ) ; for ( final Map . Entry < KeyScope , List < ResolveTask > > group : scopes . entrySet ( ) ) { final KeyScope scope = group . getKey ( ) ; final List < ResolveTask > tasks = group . getValue ( ) ; final Map < URI , URI > rewrites = tasks . stream ( ) // FIXME this should be filtered out earlier . filter ( t -> t . out != null ) . collect ( toMap ( t -> t . in . uri , t -> t . out . uri ) ) ; final KeyScope resScope = rewriteScopeTargets ( scope , rewrites ) ; tasks . stream ( ) . map ( t -> new ResolveTask ( resScope , t . in , t . out ) ) . forEach ( res :: add ) ; } return res ; }
Adjust key targets per rewrites
258
7
25,458
void walkMap ( final Element elem , final KeyScope scope , final List < ResolveTask > res ) { List < KeyScope > ss = Collections . singletonList ( scope ) ; if ( elem . getAttributeNode ( ATTRIBUTE_NAME_KEYSCOPE ) != null ) { ss = new ArrayList <> ( ) ; for ( final String keyscope : elem . getAttribute ( ATTRIBUTE_NAME_KEYSCOPE ) . trim ( ) . split ( "\\s+" ) ) { final KeyScope s = scope . getChildScope ( keyscope ) ; assert s != null ; ss . add ( s ) ; } } Attr hrefNode = elem . getAttributeNode ( ATTRIBUTE_NAME_COPY_TO ) ; if ( hrefNode == null ) { hrefNode = elem . getAttributeNode ( ATTRIBUTE_NAME_HREF ) ; } if ( hrefNode == null && SUBMAP . matches ( elem ) ) { hrefNode = elem . getAttributeNode ( ATTRIBUTE_NAME_DITA_OT_ORIG_HREF ) ; } final boolean isResourceOnly = isResourceOnly ( elem ) ; for ( final KeyScope s : ss ) { if ( hrefNode != null ) { final URI href = stripFragment ( job . getInputMap ( ) . resolve ( hrefNode . getValue ( ) ) ) ; final FileInfo fi = job . getFileInfo ( href ) ; if ( fi != null && fi . hasKeyref ) { final int count = usage . getOrDefault ( fi . uri , 0 ) ; final Optional < ResolveTask > existing = res . stream ( ) . filter ( rt -> rt . scope . equals ( s ) && rt . in . uri . equals ( fi . uri ) ) . findAny ( ) ; if ( count != 0 && existing . isPresent ( ) ) { final ResolveTask resolveTask = existing . get ( ) ; if ( resolveTask . out != null ) { final URI value = tempFileNameScheme . generateTempFileName ( resolveTask . out . result ) ; hrefNode . setValue ( value . toString ( ) ) ; } } else { final ResolveTask resolveTask = processTopic ( fi , s , isResourceOnly ) ; res . add ( resolveTask ) ; final Integer used = usage . get ( fi . uri ) ; if ( used > 1 ) { final URI value = tempFileNameScheme . generateTempFileName ( resolveTask . out . result ) ; hrefNode . setValue ( value . toString ( ) ) ; } } } } for ( final Element child : getChildElements ( elem , MAP_TOPICREF ) ) { walkMap ( child , s , res ) ; } } }
Recursively walk map and process topics that have keyrefs .
606
14
25,459
private ResolveTask processTopic ( final FileInfo f , final KeyScope scope , final boolean isResourceOnly ) { final int increment = isResourceOnly ? 0 : 1 ; final Integer used = usage . containsKey ( f . uri ) ? usage . get ( f . uri ) + increment : increment ; usage . put ( f . uri , used ) ; if ( used > 1 ) { final URI result = addSuffix ( f . result , "-" + ( used - 1 ) ) ; final URI out = tempFileNameScheme . generateTempFileName ( result ) ; final FileInfo fo = new FileInfo . Builder ( f ) . uri ( out ) . result ( result ) . build ( ) ; // TODO: Should this be added when content is actually generated? job . add ( fo ) ; return new ResolveTask ( scope , f , fo ) ; } else { return new ResolveTask ( scope , f , null ) ; } }
Determine how topic is processed for key reference processing .
206
12
25,460
private void processFile ( final ResolveTask r ) { final List < XMLFilter > filters = new ArrayList <> ( ) ; final ConkeyrefFilter conkeyrefFilter = new ConkeyrefFilter ( ) ; conkeyrefFilter . setLogger ( logger ) ; conkeyrefFilter . setJob ( job ) ; conkeyrefFilter . setKeyDefinitions ( r . scope ) ; conkeyrefFilter . setCurrentFile ( job . tempDirURI . resolve ( r . in . uri ) ) ; conkeyrefFilter . setDelayConrefUtils ( delayConrefUtils ) ; filters . add ( conkeyrefFilter ) ; filters . add ( topicFragmentFilter ) ; final KeyrefPaser parser = new KeyrefPaser ( ) ; parser . setLogger ( logger ) ; parser . setJob ( job ) ; parser . setKeyDefinition ( r . scope ) ; parser . setCurrentFile ( job . tempDirURI . resolve ( r . in . uri ) ) ; filters . add ( parser ) ; try { logger . debug ( "Using " + ( r . scope . name != null ? r . scope . name + " scope" : "root scope" ) ) ; if ( r . out != null ) { logger . info ( "Processing " + job . tempDirURI . resolve ( r . in . uri ) + " to " + job . tempDirURI . resolve ( r . out . uri ) ) ; xmlUtils . transform ( new File ( job . tempDir , r . in . file . getPath ( ) ) , new File ( job . tempDir , r . out . file . getPath ( ) ) , filters ) ; } else { logger . info ( "Processing " + job . tempDirURI . resolve ( r . in . uri ) ) ; xmlUtils . transform ( new File ( job . tempDir , r . in . file . getPath ( ) ) , filters ) ; } // validate resource-only list normalProcessingRole . addAll ( parser . getNormalProcessingRoleTargets ( ) ) ; } catch ( final DITAOTException e ) { logger . error ( "Failed to process key references: " + e . getMessage ( ) , e ) ; } }
Process key references in a topic . Topic is stored with a new name if it s been processed before .
488
21
25,461
private void writeKeyDefinition ( final Map < String , KeyDef > keydefs ) { try { KeyDef . writeKeydef ( new File ( job . tempDir , KEYDEF_LIST_FILE ) , keydefs . values ( ) ) ; } catch ( final DITAOTException e ) { logger . error ( "Failed to write key definition file: " + e . getMessage ( ) , e ) ; } }
Add key definition to job configuration
92
6
25,462
public synchronized Map < String , Argument > getPluginArguments ( ) { if ( PLUGIN_ARGUMENTS == null ) { final List < Element > params = toList ( Plugins . getPluginConfiguration ( ) . getElementsByTagName ( "param" ) ) ; PLUGIN_ARGUMENTS = params . stream ( ) . map ( ArgumentParser :: getArgument ) . collect ( Collectors . toMap ( arg -> ( "--" + arg . property ) , arg -> arg , ArgumentParser :: mergeArguments ) ) ; } return PLUGIN_ARGUMENTS ; }
Lazy load parameters
131
4
25,463
private Map < String , Object > handleArgDefine ( final String arg , final Deque < String > args ) { /* * Interestingly enough, we get to here when a user uses -Dname=value. * However, in some cases, the OS goes ahead and parses this out to args * {"-Dname", "value"} so instead of parsing on "=", we just make the * "-D" characters go away and skip one argument forward. * * I don't know how to predict when the JDK is going to help or not, so * we simply look for the equals sign. */ final Map . Entry < String , String > entry = parse ( arg . substring ( 2 ) , args ) ; if ( entry . getValue ( ) == null ) { throw new BuildException ( "Missing value for property " + entry . getKey ( ) ) ; } if ( RESERVED_PROPERTIES . containsKey ( entry . getKey ( ) ) ) { throw new BuildException ( "Property " + entry . getKey ( ) + " cannot be set with -D, use " + RESERVED_PROPERTIES . get ( entry . getKey ( ) ) + " instead" ) ; } return ImmutableMap . of ( entry . getKey ( ) , entry . getValue ( ) ) ; }
Handler - D argument
284
4
25,464
private void handleArgInput ( final String arg , final Deque < String > args , final Argument argument ) { final Map . Entry < String , String > entry = parse ( arg , args ) ; if ( entry . getValue ( ) == null ) { throw new BuildException ( "Missing value for input " + entry . getKey ( ) ) ; } inputs . add ( argument . getValue ( ( String ) entry . getValue ( ) ) ) ; }
Handler input argument
96
3
25,465
private Map < String , Object > handleParameterArg ( final String arg , final Deque < String > args , final Argument argument ) { final Map . Entry < String , String > entry = parse ( arg , args ) ; if ( entry . getValue ( ) == null ) { throw new BuildException ( "Missing value for property " + entry . getKey ( ) ) ; } return ImmutableMap . of ( argument . property , argument . getValue ( entry . getValue ( ) ) ) ; }
Handler parameter argument
105
3
25,466
private String getArgumentName ( final String arg ) { int pos = arg . indexOf ( "=" ) ; if ( pos == - 1 ) { pos = arg . indexOf ( ":" ) ; } return arg . substring ( 0 , pos != - 1 ? pos : arg . length ( ) ) ; }
Get argument name
67
3
25,467
public void setCurrentFile ( final URI currentFile ) { assert currentFile . isAbsolute ( ) ; super . setCurrentFile ( currentFile ) ; currentDir = currentFile . resolve ( "." ) ; }
Set current file absolute path
45
5
25,468
private void parseAttribute ( final Attributes atts ) { final URI attrValue = toURI ( atts . getValue ( ATTRIBUTE_NAME_HREF ) ) ; if ( attrValue == null ) { return ; } final String attrScope = atts . getValue ( ATTRIBUTE_NAME_SCOPE ) ; if ( isExternal ( attrValue , attrScope ) ) { return ; } String attrFormat = atts . getValue ( ATTRIBUTE_NAME_FORMAT ) ; if ( attrFormat == null || ATTR_FORMAT_VALUE_DITA . equals ( attrFormat ) ) { final File target = toFile ( attrValue ) ; topicHref = target . isAbsolute ( ) ? attrValue : currentDir . resolve ( attrValue ) ; if ( attrValue . getFragment ( ) != null ) { topicId = attrValue . getFragment ( ) ; } else { if ( attrFormat == null || attrFormat . equals ( ATTR_FORMAT_VALUE_DITA ) || attrFormat . equals ( ATTR_FORMAT_VALUE_DITAMAP ) ) { topicId = topicHref + QUESTION ; } } } else { topicHref = null ; topicId = null ; } }
Parse the href attribute for needed information .
283
9
25,469
private void processParseResult ( final URI currentFile ) { // Category non-copyto result and update uplevels accordingly for ( final Reference file : listFilter . getNonCopytoResult ( ) ) { categorizeReferenceFile ( file ) ; updateUplevels ( file . filename ) ; } for ( final Map . Entry < URI , URI > e : listFilter . getCopytoMap ( ) . entrySet ( ) ) { final URI source = e . getValue ( ) ; final URI target = e . getKey ( ) ; copyTo . put ( target , source ) ; updateUplevels ( target ) ; } schemeSet . addAll ( listFilter . getSchemeRefSet ( ) ) ; // collect key definitions for ( final Map . Entry < String , KeyDef > e : keydefFilter . getKeysDMap ( ) . entrySet ( ) ) { // key and value.keys will differ when keydef is a redirect to another keydef final String key = e . getKey ( ) ; final KeyDef value = e . getValue ( ) ; if ( schemeSet . contains ( currentFile ) ) { schemekeydefMap . put ( key , new KeyDef ( key , value . href , value . scope , value . format , currentFile , null ) ) ; } } hrefTargetSet . addAll ( listFilter . getHrefTargets ( ) ) ; conrefTargetSet . addAll ( listFilter . getConrefTargets ( ) ) ; nonConrefCopytoTargetSet . addAll ( listFilter . getNonConrefCopytoTargets ( ) ) ; coderefTargetSet . addAll ( listFilter . getCoderefTargets ( ) ) ; outDitaFilesSet . addAll ( listFilter . getOutFilesSet ( ) ) ; // Generate topic-scheme dictionary final Set < URI > schemeSet = listFilter . getSchemeSet ( ) ; if ( schemeSet != null && ! schemeSet . isEmpty ( ) ) { Set < URI > children = schemeDictionary . get ( currentFile ) ; if ( children == null ) { children = new HashSet <> ( ) ; } children . addAll ( schemeSet ) ; schemeDictionary . put ( currentFile , children ) ; final Set < URI > hrfSet = listFilter . getHrefTargets ( ) ; for ( final URI filename : hrfSet ) { children = schemeDictionary . get ( filename ) ; if ( children == null ) { children = new HashSet <> ( ) ; } children . addAll ( schemeSet ) ; schemeDictionary . put ( filename , children ) ; } } }
Process results from parsing a single topic or map
569
9
25,470
private void categorizeReferenceFile ( final Reference file ) { // avoid files referred by coderef being added into wait list if ( listFilter . getCoderefTargets ( ) . contains ( file . filename ) ) { return ; } if ( isFormatDita ( file . format ) && listFilter . isDitaTopic ( ) && ! job . crawlTopics ( ) && ! listFilter . getConrefTargets ( ) . contains ( file . filename ) ) { return ; // Do not process topics linked from within topics } else if ( ( isFormatDita ( file . format ) || ATTR_FORMAT_VALUE_DITAMAP . equals ( file . format ) ) ) { addToWaitList ( file ) ; } else if ( ATTR_FORMAT_VALUE_IMAGE . equals ( file . format ) ) { formatSet . add ( file ) ; if ( ! exists ( file . filename ) ) { logger . warn ( MessageUtils . getMessage ( "DOTX008E" , file . filename . toString ( ) ) . toString ( ) ) ; } } else if ( ATTR_FORMAT_VALUE_DITAVAL . equals ( file . format ) ) { formatSet . add ( file ) ; } else { htmlSet . put ( file . format , file . filename ) ; } }
Categorize file .
286
5
25,471
private String getLevelsPath ( final URI rootTemp ) { final int u = rootTemp . toString ( ) . split ( URI_SEPARATOR ) . length - 1 ; if ( u == 0 ) { return "" ; } final StringBuilder buff = new StringBuilder ( ) ; for ( int current = u ; current > 0 ; current -- ) { buff . append ( ".." ) . append ( File . separator ) ; } return buff . toString ( ) ; }
Get up - levels absolute path .
102
7
25,472
private Map < URI , URI > filterConflictingCopyTo ( final Map < URI , URI > copyTo , final Collection < FileInfo > fileInfos ) { final Set < URI > fileinfoTargets = fileInfos . stream ( ) . filter ( fi -> fi . src . equals ( fi . result ) ) . map ( fi -> fi . result ) . collect ( Collectors . toSet ( ) ) ; return copyTo . entrySet ( ) . stream ( ) . filter ( e -> ! fileinfoTargets . contains ( e . getKey ( ) ) ) . collect ( Collectors . toMap ( Map . Entry :: getKey , Map . Entry :: getValue ) ) ; }
Filter copy - to where target is used directly .
150
10
25,473
private void writeListFile ( final File inputfile , final String relativeRootFile ) { try ( Writer bufferedWriter = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( inputfile ) ) ) ) { bufferedWriter . write ( relativeRootFile ) ; bufferedWriter . flush ( ) ; } catch ( final IOException e ) { logger . error ( e . getMessage ( ) , e ) ; } }
Write list file .
91
4
25,474
private String getPrefix ( final File relativeRootFile ) { String res ; final File p = relativeRootFile . getParentFile ( ) ; if ( p != null ) { res = p . toString ( ) + File . separator ; } else { res = "" ; } return res ; }
Prefix path .
63
4
25,475
private Map < URI , Set < URI > > addMapFilePrefix ( final Map < URI , Set < URI > > map ) { final Map < URI , Set < URI > > res = new HashMap <> ( ) ; for ( final Map . Entry < URI , Set < URI > > e : map . entrySet ( ) ) { final URI key = e . getKey ( ) ; final Set < URI > newSet = new HashSet <> ( e . getValue ( ) . size ( ) ) ; for ( final URI file : e . getValue ( ) ) { newSet . add ( tempFileNameScheme . generateTempFileName ( file ) ) ; } res . put ( key . equals ( ROOT_URI ) ? key : tempFileNameScheme . generateTempFileName ( key ) , newSet ) ; } return res ; }
Convert absolute paths to relative temporary directory paths
184
9
25,476
private Map < URI , URI > addFilePrefix ( final Map < URI , URI > set ) { final Map < URI , URI > newSet = new HashMap <> ( ) ; for ( final Map . Entry < URI , URI > file : set . entrySet ( ) ) { final URI key = tempFileNameScheme . generateTempFileName ( file . getKey ( ) ) ; final URI value = tempFileNameScheme . generateTempFileName ( file . getValue ( ) ) ; newSet . put ( key , value ) ; } return newSet ; }
Add file prefix . For absolute paths the prefix is not added .
123
13
25,477
private void addFlagImagesSetToProperties ( final Job prop , final Set < URI > set ) { final Set < URI > newSet = new LinkedHashSet <> ( 128 ) ; for ( final URI file : set ) { // assert file.isAbsolute(); if ( file . isAbsolute ( ) ) { // no need to append relative path before absolute paths newSet . add ( file . normalize ( ) ) ; } else { // In ant, all the file separator should be slash, so we need to // replace all the back slash with slash. newSet . add ( file . normalize ( ) ) ; } } // write list attribute to file final String fileKey = org . dita . dost . util . Constants . REL_FLAGIMAGE_LIST . substring ( 0 , org . dita . dost . util . Constants . REL_FLAGIMAGE_LIST . lastIndexOf ( "list" ) ) + "file" ; prop . setProperty ( fileKey , org . dita . dost . util . Constants . REL_FLAGIMAGE_LIST . substring ( 0 , org . dita . dost . util . Constants . REL_FLAGIMAGE_LIST . lastIndexOf ( "list" ) ) + ".list" ) ; final File list = new File ( job . tempDir , prop . getProperty ( fileKey ) ) ; try ( Writer bufferedWriter = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( list ) ) ) ) { final Iterator < URI > it = newSet . iterator ( ) ; while ( it . hasNext ( ) ) { bufferedWriter . write ( it . next ( ) . getPath ( ) ) ; if ( it . hasNext ( ) ) { bufferedWriter . write ( "\n" ) ; } } bufferedWriter . flush ( ) ; } catch ( final IOException e ) { logger . error ( e . getMessage ( ) , e ) ; } prop . setProperty ( org . dita . dost . util . Constants . REL_FLAGIMAGE_LIST , StringUtils . join ( newSet , COMMA ) ) ; }
add FlagImangesSet to Properties which needn t to change the dir level just ouput to the ouput dir .
467
27
25,478
XMLReader getXmlReader ( final String format ) throws SAXException { if ( format == null || format . equals ( ATTR_FORMAT_VALUE_DITA ) ) { return reader ; } for ( final Map . Entry < String , String > e : parserMap . entrySet ( ) ) { if ( format . equals ( e . getKey ( ) ) ) { try { // XMLReaderFactory.createXMLReader cannot be used final XMLReader r = ( XMLReader ) Class . forName ( e . getValue ( ) ) . newInstance ( ) ; final Map < String , Boolean > features = parserFeatures . getOrDefault ( e . getKey ( ) , emptyMap ( ) ) ; for ( final Map . Entry < String , Boolean > feature : features . entrySet ( ) ) { try { r . setFeature ( feature . getKey ( ) , feature . getValue ( ) ) ; } catch ( final SAXNotRecognizedException ex ) { // Not Xerces, ignore exception } } return r ; } catch ( final InstantiationException | ClassNotFoundException | IllegalAccessException ex ) { throw new SAXException ( ex ) ; } } } return reader ; }
Get reader for input format
255
5
25,479
void initXmlReader ( ) throws SAXException { if ( parserMap . containsKey ( ATTR_FORMAT_VALUE_DITA ) ) { reader = XMLReaderFactory . createXMLReader ( parserMap . get ( ATTR_FORMAT_VALUE_DITA ) ) ; final Map < String , Boolean > features = parserFeatures . getOrDefault ( ATTR_FORMAT_VALUE_DITA , emptyMap ( ) ) ; for ( final Map . Entry < String , Boolean > feature : features . entrySet ( ) ) { try { reader . setFeature ( feature . getKey ( ) , feature . getValue ( ) ) ; } catch ( final SAXNotRecognizedException e ) { // Not Xerces, ignore exception } } } else { reader = XMLUtils . getXMLReader ( ) ; } reader . setFeature ( FEATURE_NAMESPACE_PREFIX , true ) ; if ( validate ) { reader . setFeature ( FEATURE_VALIDATION , true ) ; try { reader . setFeature ( FEATURE_VALIDATION_SCHEMA , true ) ; } catch ( final SAXNotRecognizedException e ) { // Not Xerces, ignore exception } } if ( gramcache ) { final XMLGrammarPool grammarPool = GrammarPoolManager . getGrammarPool ( ) ; try { reader . setProperty ( FEATURE_GRAMMAR_POOL , grammarPool ) ; logger . info ( "Using Xerces grammar pool for DTD and schema caching." ) ; } catch ( final NoClassDefFoundError e ) { logger . debug ( "Xerces not available, not using grammar caching" ) ; } catch ( final SAXNotRecognizedException | SAXNotSupportedException e ) { logger . warn ( "Failed to set Xerces grammar pool for parser: " + e . getMessage ( ) ) ; } } CatalogUtils . setDitaDir ( ditaDir ) ; reader . setEntityResolver ( CatalogUtils . getCatalogResolver ( ) ) ; }
XML reader used for pipeline parsing DITA documents .
442
12
25,480
private Element migrate ( Element root ) { if ( root . getAttributeNode ( PLUGIN_VERSION_ATTR ) == null ) { final List < Element > features = toList ( root . getElementsByTagName ( FEATURE_ELEM ) ) ; final String version = features . stream ( ) . filter ( elem -> elem . getAttribute ( FEATURE_ID_ATTR ) . equals ( "package.version" ) ) . findFirst ( ) . map ( elem -> elem . getAttribute ( FEATURE_VALUE_ATTR ) ) . orElse ( "0.0.0" ) ; root . setAttribute ( PLUGIN_VERSION_ATTR , version ) ; } return root ; }
Migrate from deprecated plugin format to new format
157
9
25,481
private void addExtensionPoint ( final Element elem ) { final String id = elem . getAttribute ( EXTENSION_POINT_ID_ATTR ) ; if ( id == null ) { throw new IllegalArgumentException ( EXTENSION_POINT_ID_ATTR + " attribute not set on extension-point" ) ; } final String name = elem . getAttribute ( EXTENSION_POINT_NAME_ATTR ) ; features . addExtensionPoint ( new ExtensionPoint ( id , name , currentPlugin ) ) ; }
Add extension point .
118
4
25,482
private void domToSax ( final Node root ) throws SAXException { try { final Result result = new SAXResult ( new FilterHandler ( getContentHandler ( ) ) ) ; final NodeList children = root . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { final Node links = rewriteLinks ( ( Element ) children . item ( i ) ) ; final Source source = new DOMSource ( links ) ; saxToDomTransformer . transform ( source , result ) ; } } catch ( TransformerException e ) { throw new SAXException ( "Failed to serialize DOM node to SAX: " + e . getMessage ( ) , e ) ; } }
DOM to SAX conversion methods
156
6
25,483
private void onStartElement ( QName name , XMLAttributes atts ) { if ( detecting ) { detecting = false ; loadDefaults ( ) ; } if ( defaults != null ) { checkAndAddDefaults ( name , atts ) ; } }
On start element
53
3
25,484
private boolean nullOrValue ( String test , String value ) { if ( test == null ) return true ; if ( test . equals ( value ) ) return true ; return false ; }
Test if a string is either null or equal to a certain value
38
13
25,485
private String getFromPIDataPseudoAttribute ( String data , String name , boolean unescapeValue ) { int pos = 0 ; while ( pos <= data . length ( ) - 4 ) { // minimum length of x="" int nextQuote = - 1 ; for ( int q = pos ; q < data . length ( ) ; q ++ ) { if ( data . charAt ( q ) == ' ' || data . charAt ( q ) == ' ' ) { nextQuote = q ; break ; } } if ( nextQuote < 0 ) { return null ; // if (nextQuote+1 == name.length()) return null; } int closingQuote = data . indexOf ( data . charAt ( nextQuote ) , nextQuote + 1 ) ; if ( closingQuote < 0 ) { return null ; } int nextName = data . indexOf ( name , pos ) ; if ( nextName < 0 ) { return null ; } if ( nextName < nextQuote ) { // check only spaces and equal signs between the name and the quote boolean found = true ; for ( int s = nextName + name . length ( ) ; s < nextQuote ; s ++ ) { char c = data . charAt ( s ) ; if ( ! Character . isWhitespace ( c ) && c != ' ' ) { found = false ; break ; } } if ( found ) { String val = data . substring ( nextQuote + 1 , closingQuote ) ; return unescapeValue ? unescape ( val ) : val ; } } pos = closingQuote + 1 ; } return null ; }
This method is copied from com . icl . saxon . ProcInstParser and used in the PIFinder .
334
24
25,486
private String unescape ( String value ) { if ( value . indexOf ( ' ' ) < 0 ) { return value ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < value . length ( ) ; i ++ ) { char c = value . charAt ( i ) ; if ( c == ' ' ) { if ( i + 2 < value . length ( ) && value . charAt ( i + 1 ) == ' ' ) { if ( value . charAt ( i + 2 ) == ' ' ) { int x = i + 3 ; int charval = 0 ; while ( x < value . length ( ) && value . charAt ( x ) != ' ' ) { int digit = "0123456789abcdef" . indexOf ( value . charAt ( x ) ) ; if ( digit < 0 ) { digit = "0123456789ABCDEF" . indexOf ( value . charAt ( x ) ) ; } if ( digit < 0 ) { return null ; } charval = charval * 16 + digit ; x ++ ; } char hexchar = ( char ) charval ; sb . append ( hexchar ) ; i = x ; } else { int x = i + 2 ; int charval = 0 ; while ( x < value . length ( ) && value . charAt ( x ) != ' ' ) { int digit = "0123456789" . indexOf ( value . charAt ( x ) ) ; if ( digit < 0 ) { return null ; } charval = charval * 10 + digit ; x ++ ; } char decchar = ( char ) charval ; sb . append ( decchar ) ; i = x ; } } else if ( value . substring ( i + 1 ) . startsWith ( "lt;" ) ) { sb . append ( ' ' ) ; i += 3 ; } else if ( value . substring ( i + 1 ) . startsWith ( "gt;" ) ) { sb . append ( ' ' ) ; i += 3 ; } else if ( value . substring ( i + 1 ) . startsWith ( "amp;" ) ) { sb . append ( ' ' ) ; i += 4 ; } else if ( value . substring ( i + 1 ) . startsWith ( "quot;" ) ) { sb . append ( ' ' ) ; i += 5 ; } else if ( value . substring ( i + 1 ) . startsWith ( "apos;" ) ) { sb . append ( ' ' ) ; i += 5 ; } else { return null ; } } else { sb . append ( c ) ; } } return sb . toString ( ) ; }
This method is copied from com . icl . saxon . ProcInstParser and used in the PIFinder
580
23
25,487
public void setProperty ( String propertyId , Object value ) throws XMLConfigurationException { // Xerces properties if ( propertyId . startsWith ( Constants . XERCES_PROPERTY_PREFIX ) ) { final int suffixLength = propertyId . length ( ) - Constants . XERCES_PROPERTY_PREFIX . length ( ) ; if ( suffixLength == Constants . SYMBOL_TABLE_PROPERTY . length ( ) && propertyId . endsWith ( Constants . SYMBOL_TABLE_PROPERTY ) ) { fSymbolTable = ( SymbolTable ) value ; } else if ( suffixLength == Constants . ENTITY_RESOLVER_PROPERTY . length ( ) && propertyId . endsWith ( Constants . ENTITY_RESOLVER_PROPERTY ) ) { fResolver = ( XMLEntityResolver ) value ; } } }
Sets the value of a property during parsing .
196
10
25,488
@ Override public void write ( final File filename ) throws DITAOTException { assert filename . isAbsolute ( ) ; super . write ( new File ( currentFile ) ) ; }
Process key references .
40
4
25,489
private void writeAlt ( Element srcElem ) throws SAXException { final AttributesImpl atts = new AttributesImpl ( ) ; XMLUtils . addOrSetAttribute ( atts , ATTRIBUTE_NAME_CLASS , TOPIC_ALT . toString ( ) ) ; getContentHandler ( ) . startElement ( NULL_NS_URI , TOPIC_ALT . localName , TOPIC_ALT . localName , atts ) ; domToSax ( srcElem , false ) ; getContentHandler ( ) . endElement ( NULL_NS_URI , TOPIC_ALT . localName , TOPIC_ALT . localName ) ; }
Write alt element
138
3
25,490
private boolean fallbackToNavtitleOrHref ( final Element elem ) { final String hrefValue = elem . getAttribute ( ATTRIBUTE_NAME_HREF ) ; final String locktitleValue = elem . getAttribute ( ATTRIBUTE_NAME_LOCKTITLE ) ; return ( ( ATTRIBUTE_NAME_LOCKTITLE_VALUE_YES . equals ( locktitleValue ) ) || ( "" . equals ( hrefValue ) ) || ! ( isLocalDita ( elem ) ) ) ; }
Return true when keyref text resolution should use navtitle as a final fallback .
113
17
25,491
private void domToSax ( final Element elem , final boolean retainElements , final boolean swapMapClass ) throws SAXException { if ( retainElements ) { final AttributesImpl atts = new AttributesImpl ( ) ; final NamedNodeMap attrs = elem . getAttributes ( ) ; for ( int i = 0 ; i < attrs . getLength ( ) ; i ++ ) { final Attr a = ( Attr ) attrs . item ( i ) ; if ( a . getNodeName ( ) . equals ( ATTRIBUTE_NAME_CLASS ) && swapMapClass ) { XMLUtils . addOrSetAttribute ( atts , ATTRIBUTE_NAME_CLASS , changeclassValue ( a . getNodeValue ( ) ) ) ; } else { XMLUtils . addOrSetAttribute ( atts , a ) ; } } getContentHandler ( ) . startElement ( NULL_NS_URI , elem . getNodeName ( ) , elem . getNodeName ( ) , atts ) ; } final NodeList nodeList = elem . getChildNodes ( ) ; for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { final Node node = nodeList . item ( i ) ; if ( node . getNodeType ( ) == Node . ELEMENT_NODE ) { final Element e = ( Element ) node ; // retain tm and text elements if ( TOPIC_TM . matches ( e ) || TOPIC_TEXT . matches ( e ) ) { domToSax ( e , true , swapMapClass ) ; } else { domToSax ( e , retainElements , swapMapClass ) ; } } else if ( node . getNodeType ( ) == Node . TEXT_NODE ) { final char [ ] ch = node . getNodeValue ( ) . toCharArray ( ) ; getContentHandler ( ) . characters ( ch , 0 , ch . length ) ; } } if ( retainElements ) { getContentHandler ( ) . endElement ( NULL_NS_URI , elem . getNodeName ( ) , elem . getNodeName ( ) ) ; } }
Serialize DOM node into a SAX stream .
461
10
25,492
private String changeclassValue ( final String classValue ) { final DitaClass cls = new DitaClass ( classValue ) ; if ( cls . equals ( MAP_LINKTEXT ) ) { return TOPIC_LINKTEXT . toString ( ) ; } else if ( cls . equals ( MAP_SEARCHTITLE ) ) { return TOPIC_SEARCHTITLE . toString ( ) ; } else if ( cls . equals ( MAP_SHORTDESC ) ) { return TOPIC_SHORTDESC . toString ( ) ; } else { return cls . toString ( ) ; } }
Change map type to topic type .
134
7
25,493
private static URI normalizeHrefValue ( final URI keyName , final String tail ) { if ( keyName . getFragment ( ) == null ) { return toURI ( keyName + tail . replaceAll ( SLASH , SHARP ) ) ; } return toURI ( keyName + tail ) ; }
change elementId into topicId if there is no topicId in key definition .
65
16
25,494
private static URI normalizeHrefValue ( final URI fileName , final String tail , final String topicId ) { //Insert first topic id only when topicid is not set in keydef //and keyref has elementid if ( fileName . getFragment ( ) == null && ! "" . equals ( tail ) ) { return setFragment ( fileName , topicId + tail ) ; } return toURI ( fileName + tail ) ; }
Insert topic id into href
94
5
25,495
private Range getRange ( final URI uri ) { int start = 0 ; int end = Integer . MAX_VALUE ; String startId = null ; String endId = null ; final String fragment = uri . getFragment ( ) ; if ( fragment != null ) { // RFC 5147 final Matcher m = Pattern . compile ( "^line=(?:(\\d+)|(\\d+)?,(\\d+)?)$" ) . matcher ( fragment ) ; if ( m . matches ( ) ) { if ( m . group ( 1 ) != null ) { start = Integer . parseInt ( m . group ( 1 ) ) ; end = start ; } else { if ( m . group ( 2 ) != null ) { start = Integer . parseInt ( m . group ( 2 ) ) ; } if ( m . group ( 3 ) != null ) { end = Integer . parseInt ( m . group ( 3 ) ) - 1 ; } } return new LineNumberRange ( start , end ) . handler ( this ) ; } else { final Matcher mc = Pattern . compile ( "^line-range\\((\\d+)(?:,\\s*(\\d+))?\\)$" ) . matcher ( fragment ) ; if ( mc . matches ( ) ) { start = Integer . parseInt ( mc . group ( 1 ) ) - 1 ; if ( mc . group ( 2 ) != null ) { end = Integer . parseInt ( mc . group ( 2 ) ) - 1 ; } return new LineNumberRange ( start , end ) . handler ( this ) ; } else { final Matcher mi = Pattern . compile ( "^token=([^,\\s)]*)(?:,\\s*([^,\\s)]+))?$" ) . matcher ( fragment ) ; if ( mi . matches ( ) ) { if ( mi . group ( 1 ) != null && mi . group ( 1 ) . length ( ) != 0 ) { startId = mi . group ( 1 ) ; } if ( mi . group ( 2 ) != null ) { endId = mi . group ( 2 ) ; } return new AnchorRange ( startId , endId ) . handler ( this ) ; } } } } return new AllRange ( ) . handler ( this ) ; }
Factory method for Range implementation
488
5
25,496
private Charset getCharset ( final String value ) { Charset c = null ; if ( value != null ) { final String [ ] tokens = value . trim ( ) . split ( "[;=]" ) ; if ( tokens . length >= 3 && tokens [ 1 ] . trim ( ) . equals ( "charset" ) ) { try { c = Charset . forName ( tokens [ 2 ] . trim ( ) ) ; } catch ( final RuntimeException e ) { logger . error ( MessageUtils . getMessage ( "DOTJ052E" , tokens [ 2 ] . trim ( ) ) . toString ( ) ) ; } } } if ( c == null ) { final String defaultCharset = Configuration . configuration . get ( "default.coderef-charset" ) ; if ( defaultCharset != null ) { c = Charset . forName ( defaultCharset ) ; } else { c = Charset . defaultCharset ( ) ; } } return c ; }
Get code file charset .
223
6
25,497
public boolean needExclude ( final Attributes atts , final QName [ ] [ ] extProps ) { if ( filterMap . isEmpty ( ) ) { return false ; } for ( final QName attr : filterAttributes ) { final String value = atts . getValue ( attr . getNamespaceURI ( ) , attr . getLocalPart ( ) ) ; if ( value != null ) { final Map < QName , List < String > > groups = getGroups ( value ) ; for ( Map . Entry < QName , List < String > > group : groups . entrySet ( ) ) { final QName [ ] propList = group . getKey ( ) != null ? new QName [ ] { attr , group . getKey ( ) } : new QName [ ] { attr } ; if ( extCheckExclude ( propList , group . getValue ( ) ) ) { return true ; } } } } if ( extProps != null && extProps . length != 0 ) { for ( final QName [ ] propList : extProps ) { int propListIndex = propList . length - 1 ; final QName propName = propList [ propListIndex ] ; String propValue = atts . getValue ( propName . getNamespaceURI ( ) , propName . getLocalPart ( ) ) ; while ( ( propValue == null || propValue . trim ( ) . isEmpty ( ) ) && propListIndex > 0 ) { propListIndex -- ; final QName current = propList [ propListIndex ] ; propValue = getLabelValue ( propName , atts . getValue ( current . getNamespaceURI ( ) , current . getLocalPart ( ) ) ) ; } if ( propValue != null && extCheckExclude ( propList , Arrays . asList ( propValue . split ( "\\s+" ) ) ) ) { return true ; } } } return false ; }
Check if the given Attributes need to be excluded .
417
10
25,498
private String getLabelValue ( final QName propName , final String attrPropsValue ) { if ( attrPropsValue != null ) { int propStart = - 1 ; if ( attrPropsValue . startsWith ( propName + "(" ) || attrPropsValue . contains ( " " + propName + "(" ) ) { propStart = attrPropsValue . indexOf ( propName + "(" ) ; } if ( propStart != - 1 ) { propStart = propStart + propName . toString ( ) . length ( ) + 1 ; } final int propEnd = attrPropsValue . indexOf ( ")" , propStart ) ; if ( propStart != - 1 && propEnd != - 1 ) { return attrPropsValue . substring ( propStart , propEnd ) . trim ( ) ; } } return null ; }
Get labelled props value .
189
5
25,499
private void checkRuleMapping ( final QName attName , final List < String > attValue ) { if ( attValue == null || attValue . isEmpty ( ) ) { return ; } for ( final String attSubValue : attValue ) { final FilterKey filterKey = new FilterKey ( attName , attSubValue ) ; final Action filterAction = filterMap . get ( filterKey ) ; if ( filterAction == null && logMissingAction ) { if ( ! alreadyShowed ( filterKey ) ) { logger . info ( MessageUtils . getMessage ( "DOTJ031I" , filterKey . toString ( ) ) . toString ( ) ) ; } } } }
Check if attribute value has mapping in filter configuration and throw messages .
147
13