idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
25,600 | private boolean checkPlugin ( final String currentPlugin ) { final Features pluginFeatures = pluginTable . get ( currentPlugin ) ; final Iterator < PluginRequirement > iter = pluginFeatures . getRequireListIter ( ) ; while ( iter . hasNext ( ) ) { boolean anyPluginFound = false ; final PluginRequirement requirement = i... | Check whether the plugin can be loaded . |
25,601 | private void mergePlugins ( ) { final Element root = pluginsDoc . createElement ( ELEM_PLUGINS ) ; pluginsDoc . appendChild ( root ) ; if ( ! descSet . isEmpty ( ) ) { final URI b = new File ( ditaDir , CONFIG_DIR + File . separator + "plugins.xml" ) . toURI ( ) ; for ( final File descFile : descSet ) { logger . debug ... | Merge plugin configuration files . |
25,602 | private Element parseDesc ( final File descFile ) { try { parser . setPluginDir ( descFile . getParentFile ( ) ) ; final Element root = parser . parse ( descFile . getAbsoluteFile ( ) ) ; final Features f = parser . getFeatures ( ) ; final String id = f . getPluginId ( ) ; validatePlugin ( f ) ; extensionPoints . addAl... | Parse plugin configuration file |
25,603 | private void validatePlugin ( final Features f ) { final String id = f . getPluginId ( ) ; if ( ! ID_PATTERN . matcher ( id ) . matches ( ) ) { final String msg = "Plug-in ID '" + id + "' doesn't follow syntax rules." ; throw new IllegalArgumentException ( msg ) ; } final List < String > version = f . getFeature ( "pac... | Validate plug - in configuration . |
25,604 | static String getValue ( final Map < String , Features > featureTable , final String extension ) { final List < String > buf = new ArrayList < > ( ) ; for ( final Features f : featureTable . values ( ) ) { final List < String > v = f . getFeature ( extension ) ; if ( v != null ) { buf . addAll ( v ) ; } } if ( buf . is... | Get all and combine extension values |
25,605 | public static < T > List < T > toList ( final NodeList nodes ) { final List < T > res = new ArrayList < > ( nodes . getLength ( ) ) ; for ( int i = 0 ; i < nodes . getLength ( ) ; i ++ ) { res . add ( ( T ) nodes . item ( i ) ) ; } return res ; } | Convert DOM NodeList to List . |
25,606 | public static String getPrefix ( final String qname ) { final int sep = qname . indexOf ( ':' ) ; return sep != - 1 ? qname . substring ( 0 , sep ) : DEFAULT_NS_PREFIX ; } | Get prefix from QName . |
25,607 | public static List < Element > getChildElements ( final Element elem , final DitaClass cls , final boolean deep ) { final NodeList children = deep ? elem . getElementsByTagName ( "*" ) : elem . getChildNodes ( ) ; final List < Element > res = new ArrayList < > ( children . getLength ( ) ) ; for ( int i = 0 ; i < childr... | List descendant elements by DITA class . |
25,608 | public static Optional < Element > getChildElement ( final Element elem , final String ns , final String name ) { final NodeList children = elem . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { final Node child = children . item ( i ) ; if ( child . getNodeType ( ) == Node . ELEMENT_NODE ... | Get first child element by element name . |
25,609 | public static Optional < Element > getChildElement ( final Element elem , final DitaClass cls ) { final NodeList children = elem . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { final Node child = children . item ( i ) ; if ( cls . matches ( child ) ) { return Optional . of ( ( Element ) ... | Get first child element by DITA class . |
25,610 | public static List < Element > getChildElements ( final Element elem , final String ns , final String name ) { final NodeList children = elem . getChildNodes ( ) ; final List < Element > res = new ArrayList < > ( children . getLength ( ) ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { final Node child = c... | List child elements by element name . |
25,611 | public static List < Element > getChildElements ( final Element elem , final DitaClass cls ) { return getChildElements ( elem , cls , false ) ; } | List child elements by DITA class . |
25,612 | public static List < Element > getChildElements ( final Element elem , final boolean deep ) { final NodeList children = deep ? elem . getElementsByTagName ( "*" ) : elem . getChildNodes ( ) ; final List < Element > res = new ArrayList < > ( children . getLength ( ) ) ; for ( int i = 0 ; i < children . getLength ( ) ; i... | List child elements elements . |
25,613 | public static Element getElementNode ( final Element element , final DitaClass classValue ) { final NodeList list = element . getChildNodes ( ) ; for ( int i = 0 ; i < list . getLength ( ) ; i ++ ) { final Node node = list . item ( i ) ; if ( node . getNodeType ( ) == Node . ELEMENT_NODE ) { final Element child = ( Ele... | Get specific element node from child nodes . |
25,614 | public static String getText ( final Node root ) { if ( root == null ) { return "" ; } else { final StringBuilder result = new StringBuilder ( 1024 ) ; if ( root . hasChildNodes ( ) ) { final NodeList list = root . getChildNodes ( ) ; for ( int i = 0 ; i < list . getLength ( ) ; i ++ ) { final Node childNode = list . i... | Get text value of a node . |
25,615 | public static Element searchForNode ( final Element root , final String searchKey , final String attrName , final DitaClass classValue ) { if ( root == null ) { return null ; } final Queue < Element > queue = new LinkedList < > ( ) ; queue . offer ( root ) ; while ( ! queue . isEmpty ( ) ) { final Element pe = queue . ... | Search for the special kind of node by specialized value . Equivalent to XPath |
25,616 | public static void addOrSetAttribute ( final AttributesImpl atts , final String uri , final String localName , final String qName , final String type , final String value ) { final int i = atts . getIndex ( qName ) ; if ( i != - 1 ) { atts . setAttribute ( i , uri , localName , qName , type , value ) ; } else { atts . ... | Add or set attribute . |
25,617 | public static void removeAttribute ( final AttributesImpl atts , final String qName ) { final int i = atts . getIndex ( qName ) ; if ( i != - 1 ) { atts . removeAttribute ( i ) ; } } | Remove an attribute from the list . Do nothing if attribute does not exist . |
25,618 | public static String getStringValue ( final Element element ) { final StringBuilder buf = new StringBuilder ( ) ; final NodeList children = element . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { final Node n = children . item ( i ) ; switch ( n . getNodeType ( ) ) { case Node . TEXT_NOD... | Get element node string value . |
25,619 | public void transform ( final URI input , final List < XMLFilter > filters ) throws DITAOTException { assert input . isAbsolute ( ) ; if ( ! input . getScheme ( ) . equals ( "file" ) ) { throw new IllegalArgumentException ( "Only file URI scheme supported: " + input ) ; } transform ( new File ( input ) , filters ) ; } | Transform file with XML filters . Only file URIs are supported . |
25,620 | public static void close ( final Source input ) throws IOException { if ( input != null && input instanceof StreamSource ) { final StreamSource s = ( StreamSource ) input ; final InputStream i = s . getInputStream ( ) ; if ( i != null ) { i . close ( ) ; } else { final Reader w = s . getReader ( ) ; if ( w != null ) { ... | Close source . |
25,621 | public static void close ( final Result result ) throws IOException { if ( result != null && result instanceof StreamResult ) { final StreamResult r = ( StreamResult ) result ; final OutputStream o = r . getOutputStream ( ) ; if ( o != null ) { o . close ( ) ; } else { final Writer w = r . getWriter ( ) ; if ( w != nul... | Close result . |
25,622 | public static XMLReader getXMLReader ( ) throws SAXException { XMLReader reader ; if ( System . getProperty ( SAX_DRIVER_PROPERTY ) != null ) { return XMLReaderFactory . createXMLReader ( ) ; } try { Class . forName ( SAX_DRIVER_DEFAULT_CLASS ) ; reader = XMLReaderFactory . createXMLReader ( SAX_DRIVER_DEFAULT_CLASS ) ... | Get preferred SAX parser . |
25,623 | public static DocumentBuilder getDocumentBuilder ( ) { DocumentBuilder builder ; try { builder = factory . newDocumentBuilder ( ) ; } catch ( final ParserConfigurationException e ) { throw new RuntimeException ( e ) ; } if ( Configuration . DEBUG ) { builder = new DebugDocumentBuilder ( builder ) ; } return builder ; } | Get DOM parser . |
25,624 | public static String getCascadeValue ( final Element elem , final String attrName ) { Element current = elem ; while ( current != null ) { final Attr attr = current . getAttributeNode ( attrName ) ; if ( attr != null ) { return attr . getValue ( ) ; } final Node parent = current . getParentNode ( ) ; if ( parent != nul... | Get cascaded attribute value . |
25,625 | public static Stream < Element > ancestors ( final Element element ) { final Stream . Builder < Element > builder = Stream . builder ( ) ; for ( Node current = element . getParentNode ( ) ; current != null ; current = current . getParentNode ( ) ) { if ( current . getNodeType ( ) == Node . ELEMENT_NODE ) { builder . ac... | Stream of element ancestor elements . |
25,626 | public AbstractPipelineModule createModule ( final Class < ? extends AbstractPipelineModule > moduleClass ) throws DITAOTException { try { return moduleClass . newInstance ( ) ; } catch ( final Exception e ) { final MessageBean msgBean = MessageUtils . getMessage ( "DOTJ005F" , moduleClass . getName ( ) ) ; final Strin... | Create the ModuleElem class instance according to moduleName . |
25,627 | public static synchronized CatalogResolver getCatalogResolver ( ) { if ( catalogResolver == null ) { final CatalogManager manager = new CatalogManager ( ) ; manager . setIgnoreMissingProperties ( true ) ; manager . setUseStaticCatalog ( false ) ; manager . setPreferPublic ( true ) ; final File catalogFilePath = new Fil... | Get CatalogResolver . |
25,628 | public void setup ( final LinkedHashMap < URI , URI > changeTable , final Map < URI , URI > conflictTable , final Element rootTopicref , final ChunkFilenameGenerator chunkFilenameGenerator ) { this . changeTable = changeTable ; this . rootTopicref = rootTopicref ; this . conflictTable = conflictTable ; this . chunkFile... | Set up the class . |
25,629 | URI generateOutputFile ( final URI ref ) { final FileInfo srcFi = job . getFileInfo ( ref ) ; final URI newSrc = srcFi . src . resolve ( generateFilename ( ) ) ; final URI tmp = tempFileNameScheme . generateTempFileName ( newSrc ) ; if ( job . getFileInfo ( tmp ) == null ) { job . add ( new FileInfo . Builder ( ) . res... | Generate output file . |
25,630 | Element createTopicMeta ( final Element topic ) { final Document doc = rootTopicref . getOwnerDocument ( ) ; final Element topicmeta = doc . createElement ( MAP_TOPICMETA . localName ) ; topicmeta . setAttribute ( ATTRIBUTE_NAME_CLASS , MAP_TOPICMETA . toString ( ) ) ; if ( topic != null ) { final Element title = getEl... | Create topicmeta node . |
25,631 | String getFirstTopicId ( final File ditaTopicFile ) { assert ditaTopicFile . isAbsolute ( ) ; if ( ! ditaTopicFile . isAbsolute ( ) ) { return null ; } final StringBuilder firstTopicId = new StringBuilder ( ) ; final TopicIdParser parser = new TopicIdParser ( firstTopicId ) ; try { final XMLReader reader = getXMLReader... | Get the first topic id from the given dita file . |
25,632 | void writeStartDocument ( final Writer output ) throws SAXException { try { output . write ( XML_HEAD ) ; } catch ( IOException e ) { throw new SAXException ( e ) ; } } | Convenience method to write document start . |
25,633 | void writeProcessingInstruction ( final Writer output , final String name , final String value ) throws SAXException { try { output . write ( LESS_THAN ) ; output . write ( QUESTION ) ; output . write ( name ) ; if ( value != null ) { output . write ( STRING_BLANK ) ; output . write ( value ) ; } output . write ( QUEST... | Convenience method to write a processing instruction . |
25,634 | private void insertAfter ( final URI hrefValue , final StringBuffer parentResult , final CharSequence tmpContent ) { int insertpoint = parentResult . lastIndexOf ( "</" ) ; final int end = parentResult . indexOf ( ">" , insertpoint ) ; if ( insertpoint == - 1 || end == - 1 ) { logger . error ( MessageUtils . getMessage... | Append XML content into root element |
25,635 | private void writeToContentChunk ( final String tmpContent , final URI outputFileName , final boolean needWriteDitaTag ) throws IOException { assert outputFileName . isAbsolute ( ) ; logger . info ( "Writing " + outputFileName ) ; try ( OutputStreamWriter ditaFileOutput = new OutputStreamWriter ( new FileOutputStream (... | flush the buffer to file after processing is finished |
25,636 | public static String getString ( final String key , final Locale msgLocale ) { ResourceBundle RESOURCE_BUNDLE = ResourceBundle . getBundle ( BUNDLE_NAME , msgLocale ) ; try { return RESOURCE_BUNDLE . getString ( key ) ; } catch ( final MissingResourceException e ) { return key ; } } | get specific message by key and locale . |
25,637 | public boolean findTopicId ( final File absolutePathToFile , final String id ) { if ( ! absolutePathToFile . exists ( ) ) { return false ; } try { final DocumentBuilder builder = XMLUtils . getDocumentBuilder ( ) ; builder . setEntityResolver ( CatalogUtils . getCatalogResolver ( ) ) ; final Document root = builder . p... | Find whether an id is refer to a topic in a dita file . |
25,638 | private Element searchForKey ( final Element root , final String key , final String tagName ) { if ( root == null || StringUtils . isEmptyString ( key ) ) { return null ; } final Queue < Element > queue = new LinkedList < > ( ) ; queue . offer ( root ) ; while ( ! queue . isEmpty ( ) ) { final Element pe = queue . poll... | Search specific element by key and tagName . |
25,639 | public void writeMapToXML ( final Map < String , Set < String > > m ) { final File outputFile = new File ( job . tempDir , FILE_NAME_PLUGIN_XML ) ; if ( m == null ) { return ; } final Properties prop = new Properties ( ) ; for ( Map . Entry < String , Set < String > > entry : m . entrySet ( ) ) { final String key = ent... | Write map into xml file . |
25,640 | SubjectScheme getSubjectScheme ( final Element root ) { subjectSchemeReader . reset ( ) ; logger . debug ( "Loading subject schemes" ) ; final List < Element > subjectSchemes = toList ( root . getElementsByTagName ( "*" ) ) ; subjectSchemes . stream ( ) . filter ( SUBJECTSCHEME_ENUMERATIONDEF :: matches ) . forEach ( e... | Read subject scheme definitions . |
25,641 | List < FilterUtils > combineFilterUtils ( final Element topicref , final List < FilterUtils > filters , final SubjectScheme subjectSchemeMap ) { return getChildElement ( topicref , DITAVAREF_D_DITAVALREF ) . map ( ditavalRef -> getFilterUtils ( ditavalRef ) . refine ( subjectSchemeMap ) ) . map ( f -> { final List < Fi... | Combine referenced DITAVAL to existing list and refine with subject scheme . |
25,642 | private FilterUtils getFilterUtils ( final Element ditavalRef ) { final URI href = toURI ( ditavalRef . getAttribute ( ATTRIBUTE_NAME_HREF ) ) ; final URI tmp = currentFile . resolve ( href ) ; final FileInfo fi = job . getFileInfo ( tmp ) ; final URI ditaval = fi . src ; return filterCache . computeIfAbsent ( ditaval ... | Read referenced DITAVAL and cache filter . |
25,643 | FilterUtils getFilterUtils ( final URI ditaval ) { logger . info ( "Reading " + ditaval ) ; ditaValReader . filterReset ( ) ; ditaValReader . read ( ditaval ) ; flagImageSet . addAll ( ditaValReader . getImageList ( ) ) ; relFlagImagesSet . addAll ( ditaValReader . getRelFlagImageList ( ) ) ; Map < FilterUtils . Filter... | Read DITAVAL file . |
25,644 | public static XMLGrammarPool getGrammarPool ( ) { XMLGrammarPool pool = grammarPool . get ( ) ; if ( pool == null ) { try { pool = new XMLGrammarPoolImplUtils ( ) ; grammarPool . set ( pool ) ; } catch ( final Exception e ) { System . out . println ( "Failed to create Xerces grammar pool for caching DTDs and schemas" )... | Get grammar pool |
25,645 | private static String correct ( String url ) { if ( url . startsWith ( "file://" ) && ! url . startsWith ( "file:///" ) && isWindows ( ) ) { url = "file:////" + url . substring ( "file://" . length ( ) ) ; } String userInfo = getUserInfo ( url ) ; String user = extractUser ( userInfo ) ; String pass = extractPassword (... | Method introduced to correct the URLs in the default machine encoding . This was needed by the xsltproc the catalogs URLs must be encoded in the machine encoding . |
25,646 | private static String getUserInfo ( String url ) { String userInfo = null ; int startIndex = Integer . MIN_VALUE ; int nextSlashIndex = Integer . MIN_VALUE ; int endIndex = Integer . MIN_VALUE ; try { startIndex = url . indexOf ( "//" ) ; if ( startIndex != - 1 ) { startIndex += 2 ; nextSlashIndex = url . indexOf ( '/'... | Extract the user info from an URL . |
25,647 | private static String extractUser ( String userInfo ) { if ( userInfo == null ) { return null ; } int index = userInfo . lastIndexOf ( ':' ) ; if ( index == - 1 ) { return userInfo ; } else { return userInfo . substring ( 0 , index ) ; } } | Gets the user from an userInfo string obtained from the starting URL . Used only by the constructor . |
25,648 | private static String extractPassword ( String userInfo ) { if ( userInfo == null ) { return null ; } String password = "" ; int index = userInfo . lastIndexOf ( ':' ) ; if ( index != - 1 && index < userInfo . length ( ) - 1 ) { password = userInfo . substring ( index + 1 ) ; } return password ; } | Gets the password from an user info string obtained from the starting URL . |
25,649 | private static URL clearUserInfo ( String systemID ) { try { URL url = new URL ( systemID ) ; if ( ! "file" . equals ( url . getProtocol ( ) ) ) { return attachUserInfo ( url , null , null ) ; } return url ; } catch ( MalformedURLException e ) { return null ; } } | Clears the user info from an url . |
25,650 | private static URL attachUserInfo ( URL url , String user , char [ ] password ) throws MalformedURLException { if ( url == null ) { return null ; } if ( ( url . getAuthority ( ) == null || "" . equals ( url . getAuthority ( ) ) ) && ! "jar" . equals ( url . getProtocol ( ) ) ) { return url ; } StringBuilder buf = new S... | Build the URL from the data obtained from the user . |
25,651 | private static String correctUser ( String user ) { if ( user != null && user . trim ( ) . length ( ) > 0 && ( false || user . indexOf ( '%' ) == - 1 ) ) { String escaped = escapeSpecialAsciiAndNonAscii ( user ) ; StringBuilder totalEscaped = new StringBuilder ( ) ; for ( int i = 0 ; i < escaped . length ( ) ; i ++ ) {... | Escape the specified user . |
25,652 | private static char [ ] correctPassword ( char [ ] password ) { if ( password != null && new String ( password ) . indexOf ( '%' ) == - 1 ) { String escaped = escapeSpecialAsciiAndNonAscii ( new String ( password ) ) ; StringBuilder totalEscaped = new StringBuilder ( ) ; for ( int i = 0 ; i < escaped . length ( ) ; i +... | Escape the specified password . |
25,653 | private void read ( ) throws IOException { lastModified = jobFile . lastModified ( ) ; if ( jobFile . exists ( ) ) { try ( final InputStream in = new FileInputStream ( jobFile ) ) { final XMLReader parser = XMLUtils . getXMLReader ( ) ; parser . setContentHandler ( new JobHandler ( prop , files ) ) ; parser . parse ( n... | Read temporary configuration files . If configuration files are not found assume an empty job object is being created . |
25,654 | public Map < String , String > getProperties ( ) { final Map < String , String > res = new HashMap < > ( ) ; for ( final Map . Entry < String , Object > e : prop . entrySet ( ) ) { if ( e . getValue ( ) instanceof String ) { res . put ( e . getKey ( ) , ( String ) e . getValue ( ) ) ; } } return Collections . unmodifia... | Get a map of string properties . |
25,655 | public Object setProperty ( final String key , final String value ) { return prop . put ( key , value ) ; } | Set property value . |
25,656 | public URI getInputMap ( ) { return files . values ( ) . stream ( ) . filter ( fi -> fi . isInput ) . map ( fi -> getInputDir ( ) . relativize ( fi . src ) ) . findAny ( ) . orElse ( null ) ; } | Get input file |
25,657 | public void setInputMap ( final URI map ) { assert ! map . isAbsolute ( ) ; setProperty ( INPUT_DITAMAP_URI , map . toString ( ) ) ; setProperty ( INPUT_DITAMAP , toFile ( map ) . getPath ( ) ) ; } | set input file |
25,658 | public void setInputDir ( final URI dir ) { assert dir . isAbsolute ( ) ; setProperty ( INPUT_DIR_URI , dir . toString ( ) ) ; if ( dir . getScheme ( ) . equals ( "file" ) ) { setProperty ( INPUT_DIR , new File ( dir ) . getAbsolutePath ( ) ) ; } } | Set input directory |
25,659 | public Map < File , FileInfo > getFileInfoMap ( ) { final Map < File , FileInfo > ret = new HashMap < > ( ) ; for ( final Map . Entry < URI , FileInfo > e : files . entrySet ( ) ) { ret . put ( e . getValue ( ) . file , e . getValue ( ) ) ; } return Collections . unmodifiableMap ( ret ) ; } | Get all file info objects as a map |
25,660 | public Collection < FileInfo > getFileInfo ( final Predicate < FileInfo > filter ) { return files . values ( ) . stream ( ) . filter ( filter ) . collect ( Collectors . toList ( ) ) ; } | Get file info objects that pass the filter |
25,661 | public FileInfo getFileInfo ( final URI file ) { if ( file == null ) { return null ; } else if ( files . containsKey ( file ) ) { return files . get ( file ) ; } else if ( file . isAbsolute ( ) && file . toString ( ) . startsWith ( tempDirURI . toString ( ) ) ) { final URI relative = getRelativePath ( jobFile . toURI (... | Get file info object |
25,662 | public FileInfo getOrCreateFileInfo ( final URI file ) { assert file . getFragment ( ) == null ; URI f = file . normalize ( ) ; if ( f . isAbsolute ( ) ) { f = tempDirURI . relativize ( f ) ; } FileInfo i = getFileInfo ( file ) ; if ( i == null ) { i = new FileInfo ( f ) ; add ( i ) ; } return i ; } | Get or create FileInfo for given path . |
25,663 | public void setOutterControl ( final String control ) { prop . put ( PROPERTY_OUTER_CONTROL , OutterControl . valueOf ( control . toUpperCase ( ) ) . toString ( ) ) ; } | Set the outercontrol . |
25,664 | public boolean crawlTopics ( ) { if ( prop . get ( PROPERTY_LINK_CRAWLER ) == null ) { return true ; } return prop . get ( PROPERTY_LINK_CRAWLER ) . toString ( ) . equals ( ANT_INVOKER_EXT_PARAM_CRAWL_VALUE_TOPIC ) ; } | Retrieve the link crawling behaviour . |
25,665 | public File getOutputDir ( ) { if ( prop . containsKey ( PROPERTY_OUTPUT_DIR ) ) { return new File ( prop . get ( PROPERTY_OUTPUT_DIR ) . toString ( ) ) ; } return null ; } | Get output dir . |
25,666 | public URI getInputFile ( ) { return files . values ( ) . stream ( ) . filter ( fi -> fi . isInput ) . map ( fi -> fi . src ) . findAny ( ) . orElse ( null ) ; } | Get input file path . |
25,667 | public void setInputFile ( final URI inputFile ) { assert inputFile . isAbsolute ( ) ; prop . put ( PROPERTY_INPUT_MAP_URI , inputFile . toString ( ) ) ; if ( inputFile . getScheme ( ) . equals ( "file" ) ) { prop . put ( PROPERTY_INPUT_MAP , new File ( inputFile ) . getAbsolutePath ( ) ) ; } } | Set input map path . |
25,668 | public TempFileNameScheme getTempFileNameScheme ( ) { final TempFileNameScheme tempFileNameScheme ; try { final String cls = Optional . ofNullable ( getProperty ( "temp-file-name-scheme" ) ) . orElse ( configuration . get ( "temp-file-name-scheme" ) ) ; tempFileNameScheme = ( GenMapAndTopicListModule . TempFileNameSche... | Get temporary file name generator . |
25,669 | public static IndexEntry [ ] processIndexString ( final String theIndexMarkerString , final List < Node > contents ) { final IndexEntryImpl indexEntry = createIndexEntry ( theIndexMarkerString , contents , null , false ) ; final StringBuffer referenceIDBuf = new StringBuffer ( ) ; referenceIDBuf . append ( indexEntry .... | Parse the index marker string and create IndexEntry object from one . |
25,670 | public static String normalizeTextValue ( final String theString ) { if ( null != theString && theString . length ( ) > 0 ) { return theString . replaceAll ( "[\\s\\n]+" , " " ) . trim ( ) ; } return theString ; } | Method equals to the normalize - space xslt function |
25,671 | public void setTempdir ( final File tempdir ) { this . tempDir = tempdir . getAbsoluteFile ( ) ; attrs . put ( ANT_INVOKER_PARAM_TEMPDIR , tempdir . getAbsolutePath ( ) ) ; } | Set temporary directory . |
25,672 | public void execute ( ) throws BuildException { initialize ( ) ; final Job job = getJob ( tempDir , getProject ( ) ) ; try { for ( final ModuleElem m : modules ) { m . setProject ( getProject ( ) ) ; m . setLocation ( getLocation ( ) ) ; final PipelineHashIO pipelineInput = new PipelineHashIO ( ) ; for ( final Map . En... | Execution point of this invoker . |
25,673 | public static Job getJob ( final File tempDir , final Project project ) { Job job = project . getReference ( ANT_REFERENCE_JOB ) ; if ( job != null && job . isStale ( ) ) { project . log ( "Reload stale job configuration reference" , Project . MSG_VERBOSE ) ; job = null ; } if ( job == null ) { try { job = new Job ( te... | Get job configuration from Ant project reference or create new . |
25,674 | public static MessageBean getMessage ( final String id , final String ... params ) { if ( ! msgs . containsKey ( id ) ) { throw new IllegalArgumentException ( "Message for ID '" + id + "' not found" ) ; } final String msg = MessageFormat . format ( msgs . getString ( id ) , ( Object [ ] ) params ) ; MessageBean . Type ... | Get the message respond to the given id with all of the parameters are replaced by those in the given prop if no message found an empty message with this id will be returned . |
25,675 | protected void insertRelaxDefaultsComponent ( ) { if ( fRelaxDefaults == null ) { fRelaxDefaults = new RelaxNGDefaultsComponent ( resolver ) ; addCommonComponent ( fRelaxDefaults ) ; fRelaxDefaults . reset ( this ) ; } XMLDocumentSource prev = fLastComponent ; fLastComponent = fRelaxDefaults ; XMLDocumentHandler next =... | Insert the Relax NG defaults component |
25,676 | public void reset ( ) { targetFile = null ; title = null ; defaultTitle = null ; inTitleElement = false ; termStack . clear ( ) ; topicIdStack . clear ( ) ; indexTermSpecList . clear ( ) ; indexSeeSpecList . clear ( ) ; indexSeeAlsoSpecList . clear ( ) ; indexSortAsSpecList . clear ( ) ; topicSpecList . clear ( ) ; ind... | Reset the reader . |
25,677 | private IndexTermTarget genTarget ( ) { final IndexTermTarget target = new IndexTermTarget ( ) ; String fragment ; if ( topicIdStack . peek ( ) == null ) { fragment = null ; } else { fragment = topicIdStack . peek ( ) ; } if ( title != null ) { target . setTargetName ( title ) ; } else { target . setTargetName ( target... | This method is used to create a target which refers to current topic . |
25,678 | private void updateIndexTermTargetName ( ) { if ( defaultTitle == null ) { defaultTitle = targetFile ; } for ( final IndexTerm indexterm : indexTermList ) { updateIndexTermTargetName ( indexterm ) ; } } | Update the target name of constructed IndexTerm recursively |
25,679 | private void updateIndexTermTargetName ( final IndexTerm indexterm ) { final int targetSize = indexterm . getTargetList ( ) . size ( ) ; final int subtermSize = indexterm . getSubTerms ( ) . size ( ) ; for ( int i = 0 ; i < targetSize ; i ++ ) { final IndexTermTarget target = indexterm . getTargetList ( ) . get ( i ) ;... | Update the target name of each IndexTerm recursively . |
25,680 | private static String trimSpaceAtStart ( final String temp , final String termName ) { if ( termName != null && termName . charAt ( termName . length ( ) - 1 ) == ' ' ) { if ( temp . charAt ( 0 ) == ' ' ) { return temp . substring ( 1 ) ; } } return temp ; } | Trim whitespace from start of the string . If last character of termName and first character of temp is a space character remove leading string from temp |
25,681 | public AbstractPipelineOutput execute ( final AbstractPipelineInput input ) throws DITAOTException { final String transtype = input . getAttribute ( ANT_INVOKER_EXT_PARAM_TRANSTYPE ) ; final ChunkMapReader mapReader = new ChunkMapReader ( ) ; mapReader . setLogger ( logger ) ; mapReader . setJob ( job ) ; mapReader . s... | Entry point of chunk module . |
25,682 | private boolean hasChanges ( final Map < URI , URI > changeTable ) { if ( changeTable . isEmpty ( ) ) { return false ; } for ( Map . Entry < URI , URI > e : changeTable . entrySet ( ) ) { if ( ! e . getKey ( ) . equals ( e . getValue ( ) ) ) { return true ; } } return false ; } | Test whether there are changes that require topic rewriting . |
25,683 | private boolean isEclipseMap ( final URI mapFile ) throws DITAOTException { final DocumentBuilder builder = getDocumentBuilder ( ) ; Document doc ; try { doc = builder . parse ( mapFile . toString ( ) ) ; } catch ( final SAXException | IOException e ) { throw new DITAOTException ( "Failed to parse input map: " + e . ge... | Check whether ditamap is an Eclipse specialization . |
25,684 | private void updateRefOfDita ( final Map < URI , URI > changeTable , final Map < URI , URI > conflictTable ) { final TopicRefWriter topicRefWriter = new TopicRefWriter ( ) ; topicRefWriter . setLogger ( logger ) ; topicRefWriter . setJob ( job ) ; topicRefWriter . setChangeTable ( changeTable ) ; topicRefWriter . setup... | Update href attributes in ditamap and topic files . |
25,685 | public void addTerm ( final IndexTerm term ) { int i = 0 ; final int termNum = termList . size ( ) ; for ( ; i < termNum ; i ++ ) { final IndexTerm indexTerm = termList . get ( i ) ; if ( indexTerm . equals ( term ) ) { return ; } if ( indexTerm . getTermFullName ( ) . equals ( term . getTermFullName ( ) ) && indexTerm... | All a new term into the collection . |
25,686 | public void sort ( ) { if ( IndexTerm . getTermLocale ( ) == null || IndexTerm . getTermLocale ( ) . getLanguage ( ) . trim ( ) . length ( ) == 0 ) { IndexTerm . setTermLocale ( new Locale ( LANGUAGE_EN , COUNTRY_US ) ) ; } for ( final IndexTerm term : termList ) { term . sortSubTerms ( ) ; } Collections . sort ( termL... | Sort term list extracted from dita files base on Locale . |
25,687 | public void outputTerms ( ) throws DITAOTException { StringBuilder buff = new StringBuilder ( outputFileRoot ) ; AbstractWriter abstractWriter = null ; if ( indexClass != null && indexClass . length ( ) > 0 ) { Class < ? > anIndexClass ; try { anIndexClass = Class . forName ( indexClass ) ; abstractWriter = ( AbstractW... | Output index terms into index file . |
25,688 | boolean skipUnlockedNavtitle ( final Element metadataContainer , final Element checkForNavtitle ) { if ( ! TOPIC_TITLEALTS . matches ( metadataContainer ) || ! TOPIC_NAVTITLE . matches ( checkForNavtitle ) ) { return false ; } else if ( checkForNavtitle . getAttributeNodeNS ( DITA_OT_NS , ATTRIBUTE_NAME_LOCKTITLE ) == ... | Check if an element is an unlocked navtitle which should not be pushed into topics . |
25,689 | private List < Element > getNewChildren ( final DitaClass cls , final Document doc ) { final List < Element > res = new ArrayList < > ( ) ; if ( metaTable . containsKey ( cls . matcher ) ) { metaTable . get ( cls . matcher ) ; final NodeList list = metaTable . get ( cls . matcher ) . getChildNodes ( ) ; for ( int i = 0... | Get metadata elements to add to current document . Elements have been cloned and imported into the current document . |
25,690 | private void createTopicStump ( final URI newFile ) { try ( final OutputStream newFileWriter = new FileOutputStream ( new File ( newFile ) ) ) { final XMLStreamWriter o = XMLOutputFactory . newInstance ( ) . createXMLStreamWriter ( newFileWriter , UTF8 ) ; o . writeStartDocument ( ) ; o . writeProcessingInstruction ( P... | Create the new topic stump . |
25,691 | private void readProcessingInstructions ( final Document doc ) { final NodeList docNodes = doc . getChildNodes ( ) ; for ( int i = 0 ; i < docNodes . getLength ( ) ; i ++ ) { final Node node = docNodes . item ( i ) ; if ( node . getNodeType ( ) == Node . PROCESSING_INSTRUCTION_NODE ) { final ProcessingInstruction pi = ... | Read processing metadata from processing instructions . |
25,692 | private void processNavitation ( final Element topicref ) { final Element root = ( Element ) topicref . getOwnerDocument ( ) . getDocumentElement ( ) . cloneNode ( false ) ; final Element navref = topicref . getOwnerDocument ( ) . createElement ( MAP_NAVREF . localName ) ; final String newMapFile = chunkFilenameGenerat... | Create new map and refer to it with navref . |
25,693 | private void generateStumpTopic ( final Element topicref ) { final URI result = getResultFile ( topicref ) ; final URI temp = tempFileNameScheme . generateTempFileName ( result ) ; final URI absTemp = job . tempDir . toURI ( ) . resolve ( temp ) ; final String name = getBaseName ( new File ( result ) . getName ( ) ) ; ... | Generate stump topic for to - content content . |
25,694 | private void createChildTopicrefStubs ( final List < Element > topicrefs ) { if ( ! topicrefs . isEmpty ( ) ) { for ( final Element currentElem : topicrefs ) { final String href = getValue ( currentElem , ATTRIBUTE_NAME_HREF ) ; final String chunk = getValue ( currentElem , ATTRIBUTE_NAME_CHUNK ) ; if ( href == null &&... | Before combining topics in a branch ensure any descendant topicref with |
25,695 | public Map < URI , URI > getChangeTable ( ) { for ( final Map . Entry < URI , URI > e : changeTable . entrySet ( ) ) { assert e . getKey ( ) . isAbsolute ( ) ; assert e . getValue ( ) . isAbsolute ( ) ; } return Collections . unmodifiableMap ( changeTable ) ; } | Get changed files table . |
25,696 | public Map < URI , URI > getConflicTable ( ) { for ( final Map . Entry < URI , URI > e : conflictTable . entrySet ( ) ) { assert e . getKey ( ) . isAbsolute ( ) ; assert e . getValue ( ) . isAbsolute ( ) ; } return conflictTable ; } | get conflict table . |
25,697 | public void getResult ( final ContentHandler buf ) throws SAXException { for ( final Value value : valueSet ) { final String [ ] tokens = value . value . split ( "[/\\\\]" , 2 ) ; buf . startElement ( NULL_NS_URI , "import" , "import" , XMLUtils . EMPTY_ATTRIBUTES ) ; buf . startElement ( NULL_NS_URI , "fileset" , "fil... | Generate Ant import task . |
25,698 | public void setAttribute ( final String name , final String value ) { hash . put ( name , value ) ; } | Set the attribute vale with name into hash map . |
25,699 | public String getAttribute ( final String name ) { String value ; value = hash . get ( name ) ; return value ; } | Get the attribute value according to its name . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.