当前位置: 首页>>代码示例>>Java>>正文


Java Comment类代码示例

本文整理汇总了Java中org.jdom.Comment的典型用法代码示例。如果您正苦于以下问题:Java Comment类的具体用法?Java Comment怎么用?Java Comment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Comment类属于org.jdom包,在下文中一共展示了Comment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveReplayElement

import org.jdom.Comment; //导入依赖的package包/类
private static Element saveReplayElement(FileServerStream replay)
{	Element result = new Element(XmlNames.REPLAY); 
	
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);
	
	// level
	Element tournamentElement = saveLevelElement(replay);
	result.addContent(tournamentElement);

	// date
	Element datesElement = saveDateElement(replay);
	result.addContent(datesElement);

	// players
	Element playersElement = savePlayersElement(replay);
	result.addContent(playersElement);

	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:22,代码来源:ReplaySaver.java

示例2: saveAiElement

import org.jdom.Comment; //导入依赖的package包/类
/**
 * Crée un des élements du fichier XML.
 * 
 * @param aiPreview
 * 		Objet décrivant l'agent.
 * @return
 * 		L'élément XML créé.
 */
private static Element saveAiElement(AiPreview aiPreview)
{	Element result = new Element(XmlNames.AI); 
	
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);
	
	// notes
	Element notesElement = saveNotesElement(aiPreview);
	result.addContent(notesElement);
	
	// authors
	Element authorsElement = saveAuthorsElement(aiPreview);
	result.addContent(authorsElement);

	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:26,代码来源:AiPreviewSaver.java

示例3: savePlayersElement

import org.jdom.Comment; //导入依赖的package包/类
/**
 * Generates the players XML element.
 * 
 * @param players
 * 		Original object.
 * @return
 * 		XML element.
 */
private static Element savePlayersElement(Players players)
{	Element result = new Element(XmlNames.PLAYERS);
	
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);

	// locations
	Map<Integer,PlayerLocation[]> locations = players.getLocations();
	Element locationsElement = saveLocationsElement(locations);
	result.addContent(locationsElement);

	// items
	Map<String,Integer> items = players.getInitialItems();
	Element itemsElement = saveItemsElement(items);
	result.addContent(itemsElement);

	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:28,代码来源:PlayersSaver.java

示例4: saveZoneElement

import org.jdom.Comment; //导入依赖的package包/类
/**
 * Initializes the root element of the xml file.
 * 
 * @param zone
 * 		Zone to record.
 * @return
 * 		Root XML element.
 */
private static Element saveZoneElement(Zone zone)
{	Element result = new Element(XmlNames.ZONE);
	
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);

	// tiles random variable
	Map<String,VariableTile> variableTiles = zone.getVariableTiles();
	if(!variableTiles.isEmpty())
	{	Element variableTilesElement = VariableTilesSaver.saveVariableTilesElement(variableTiles);
		result.addContent(variableTilesElement);
	}
	
	// matrix
	Element matrixElement = saveMatrixElement(zone);
	result.addContent(matrixElement);
	
	// events
	Element eventsElement = saveEventsElement(zone);
	if(eventsElement!=null)
		result.addContent(eventsElement);
	
	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:34,代码来源:ZoneSaver.java

示例5: saveGameQuickStartElement

import org.jdom.Comment; //导入依赖的package包/类
private static Element saveGameQuickStartElement(QuickStartConfiguration quickStartConfiguration)
{	Element result = new Element(XmlNames.GAME_QUICKSTART); 
		
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);
	
	// round
	Element roundElement = saveRoundELement(quickStartConfiguration);
	result.addContent(roundElement);

	// players
	Element playersElement = new Element(XmlNames.PLAYERS);
	ProfilesSelection quickStartSelected = quickStartConfiguration.getProfilesSelection();
	ProfilesSelectionSaver.saveProfilesSelection(playersElement,quickStartSelected);
	result.addContent(playersElement);
	
	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:20,代码来源:QuickStartConfigurationSaver.java

示例6: saveConnectionsElement

import org.jdom.Comment; //导入依赖的package包/类
/**
 * Builds an XML element representing
 * network-related settings.
 * 
 * @param connectionsConfiguration
 * 		Settings to be recorded.
 * @return
 * 		Resulting XML element.
 */
private static Element saveConnectionsElement(ConnectionsConfiguration connectionsConfiguration)
{	Element result = new Element(XmlNames.CONNECTIONS); 

	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);

	// central
	Element centralElement = saveCentralElement(connectionsConfiguration);
	result.addContent(centralElement);
	
	// hosting
	Element hostingElement = saveHostingElement(connectionsConfiguration);
	result.addContent(hostingElement);
	
	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:27,代码来源:ConnectionsConfigurationSaver.java

示例7: saveEngineElement

import org.jdom.Comment; //导入依赖的package包/类
private static Element saveEngineElement(EngineConfiguration engineConfiguration)
{	Element result = new Element(XmlNames.ENGINE); 

	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);

	// timing
	Element timingElement = saveTimingElement(engineConfiguration);
	result.addContent(timingElement);
	
	// logs
	Element logElement = saveLogElement(engineConfiguration);
	result.addContent(logElement);
	
	// cache
	Element cacheElement = saveCacheElement(engineConfiguration);
	result.addContent(cacheElement);
	
	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:22,代码来源:EngineConfigurationSaver.java

示例8: saveProfilesElement

import org.jdom.Comment; //导入依赖的package包/类
private static Element saveProfilesElement(ProfilesConfiguration profilesConfiguration)
{	Element result = new Element(XmlNames.PROFILES);
	
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);

	// general
	Element generalElement = saveGeneralElement(profilesConfiguration);
	result.addContent(generalElement);
	
	// list
	Element listElement = saveListElement(profilesConfiguration);
	result.addContent(listElement);

	return result;		
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:18,代码来源:ProfilesConfigurationSaver.java

示例9: saveVideoElement

import org.jdom.Comment; //导入依赖的package包/类
private static Element saveVideoElement(VideoConfiguration videoConfiguration)
{	Element result = new Element(XmlNames.VIDEO); 
	
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);
	
	// full screen
	Element fullScreenElement = saveFullScreenElement(videoConfiguration);
	result.addContent(fullScreenElement);
	
	// smoothing
	Element smoothingElement = saveSmoothGraphicsElement(videoConfiguration);
	result.addContent(smoothingElement);
	
	// panel dimension
	Element panelElement = savePanelDimensionElement(videoConfiguration);
	result.addContent(panelElement);
	
	// border color
	Element borderElement = saveBorderElement(videoConfiguration);
	result.addContent(borderElement);
	
	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:26,代码来源:VideoConfigurationSaver.java

示例10: getGplComment

import org.jdom.Comment; //导入依赖的package包/类
/**
 * Returns a comment node to put
 * in an XML document.
 * 
 * @return
 * 		The corresponding comment node.
 */
public static Comment getGplComment()
{	StringBuffer text = new StringBuffer();
	text.append("\n");
	text.append("\tTotal Boum Boum\n");
	text.append("\tCopyright 2008-2014 Vincent Labatut\n");
	text.append("\t\n");
	text.append("\tThis file is part of Total Boum Boum.\n");
	text.append("\t\n");
	text.append("\tTotal Boum Boum is free software: you can redistribute it and/or modify\n");
	text.append("\tit under the terms of the GNU General Public License as published by\n");
	text.append("\tthe Free Software Foundation, either version 2 of the License, or\n");
	text.append("\t(at your option) any later version.\n");
	text.append("\t\n");
	text.append("\tTotal Boum Boum is distributed in the hope that it will be useful,\n");
	text.append("\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n");
	text.append("\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n");
	text.append("\tGNU General Public License for more details.\n");
	text.append("\t\n");
	text.append("\tYou should have received a copy of the GNU General Public License\n");
	text.append("\talong with Total Boum Boum.  If not, see http://www.gnu.org/licenses.\n");
	Comment result = new Comment(text.toString());
	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:31,代码来源:XmlTools.java

示例11: saveGuiElement

import org.jdom.Comment; //导入依赖的package包/类
private static Element saveGuiElement(MiscConfiguration engineConfiguration)
{	Element result = new Element(GuiXmlTools.ELT_CONFIGURATION); 
	
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);

	// language
	Element languageElement = saveLanguageElement(engineConfiguration);
	result.addContent(languageElement);
	
	// font
	Element fontElement = saveFontElement(engineConfiguration);
	result.addContent(fontElement);
	
	// background
	Element backgroundElement = saveBackgroundElement(engineConfiguration);
	result.addContent(backgroundElement);
	
	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:22,代码来源:MiscConfigurationSaver.java

示例12: getContentValue

import org.jdom.Comment; //导入依赖的package包/类
/**
 * Get the best content value for a JDOM object.  For elements, the content text is returned.  
 * For attributes, the attribute value is returned.  For namespaces, the URI is returned.  Etc...    
 * @param jdomObject JDOM object such as Element, Attribute, Text, Namespace, Comment, ProcessingInstruction, String
 * @return Content value for the specified JDOM object
 * @since 4.2
 */
public static String getContentValue( Object jdomObject ) {
    if(jdomObject == null) {
        return null; 
    } else if(jdomObject instanceof String) {
        return (String)jdomObject;
    } else if(jdomObject instanceof Element) {
        return ((Element)jdomObject).getText();
    } else if(jdomObject instanceof Attribute) {
        return ((Attribute)jdomObject).getValue();
    } else if(jdomObject instanceof Text) {
        return ((Text)jdomObject).getValue();
    } else if(jdomObject instanceof Namespace) {
        return ((Namespace)jdomObject).getURI();
    } else if(jdomObject instanceof Comment) {
        return ((Comment)jdomObject).getText();
    } else if(jdomObject instanceof ProcessingInstruction) {
        return ((ProcessingInstruction)jdomObject).getData();
    }
    
    // Default
    return jdomObject.toString();        
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:30,代码来源:JdomHelper.java

示例13: printComment

import org.jdom.Comment; //导入依赖的package包/类
/** Stop XMLOutputter from printing comment <!-- --> chars if it is just a newline */
@Override
protected void printComment(Writer stringWriter, Comment comment) throws IOException {
    if (comment instanceof NewlineText) {
        if (!indentBlankLines) {
            clearIndentationForCurrentLine(stringWriter);
        }
    } else {
        super.printComment(stringWriter, comment);
    }
}
 
开发者ID:Ekryd,项目名称:sortpom,代码行数:12,代码来源:XmlOutputGenerator.java

示例14: saveProfileElement

import org.jdom.Comment; //导入依赖的package包/类
/**
 * Processes the main profile element of the XML file.
 * 
 * @param profile
 * 		Profile object.
 * @return
 * 		Produced XML element.
 */
private static Element saveProfileElement(Profile profile)
{	Element result = new Element(XmlNames.PROFILE);
	
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);

	// general properties
	Element generalElement = saveGeneralElement(profile);
	result.addContent(generalElement);
	
	// artificial intelligence
	if(profile.hasAi())
	{	Element aiElement = saveAiElement(profile);
		result.addContent(aiElement);
	}
	
	// sprite info
	Element characterElement = saveCharacterElement(profile);
	result.addContent(characterElement);
	
	// network stuff
	Element networkElement = saveNetworkElement(profile);
	result.addContent(networkElement);

	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:36,代码来源:ProfileSaver.java

示例15: saveHostsElement

import org.jdom.Comment; //导入依赖的package包/类
private static Element saveHostsElement(Map<String,HostInfo> hosts)
{	Element result = new Element(XmlNames.HOST);
	
	// GPL comment
	Comment gplComment = XmlTools.getGplComment();
	result.addContent(gplComment);

	for(HostInfo host: hosts.values())
	{	Element hostElement = saveHostElement(host);
		result.addContent(hostElement);
	}
	
	return result;
}
 
开发者ID:vlabatut,项目名称:totalboumboum,代码行数:15,代码来源:HostsSaver.java


注:本文中的org.jdom.Comment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。