List of usage examples for java.lang Boolean FALSE
Boolean FALSE
To view the source code for java.lang Boolean FALSE.
Click Source Link
From source file:de.bruse.c2x.cli.Main.java
public static void main(String[] args) { CommandLineParser parser = new GnuParser(); Options options = new Options(); Option input = new Option("i", INPUT, HAS_ARGS, "CityGML file to be converted."); input.setArgs(ONE);//from www .ja v a 2s .c o m input.setArgName(INPUT); input.setRequired(Boolean.TRUE); options.addOption(input); Option levelOfDetail = new Option("l", LEVEL_OF_DETAIL, HAS_ARGS, "Level of detail to be converted. Possible values are LOD1 and LOD2."); levelOfDetail.setArgs(ONE); levelOfDetail.setArgName(LEVEL_OF_DETAIL); levelOfDetail.setRequired(Boolean.TRUE); options.addOption(levelOfDetail); Option geometryType = new Option("t", GEOMETRY_TYPE, HAS_ARGS, "Geometry type to be converted. Possible values are SOLID and MULTI_SURFACE."); geometryType.setArgs(ONE); geometryType.setArgName(GEOMETRY_TYPE); geometryType.setRequired(Boolean.TRUE); options.addOption(geometryType); Option output = new Option("o", OUTPUT, HAS_ARGS, "File path of the output file."); output.setArgs(ONE); output.setArgName(OUTPUT); output.setRequired(Boolean.FALSE); options.addOption(output); Option targetFormat = new Option("f", FORMAT, HAS_ARGS, "Format of the output file. Possible values are X3D and COLLADA."); targetFormat.setArgs(ONE); targetFormat.setArgName(FORMAT); targetFormat.setRequired(Boolean.TRUE); options.addOption(targetFormat); Option split = new Option("s", SPLIT, NO_ARGS, "Generate one scene node for each building (X3D only)."); split.setArgName(SPLIT); split.setRequired(Boolean.FALSE); options.addOption(split); Option validate = new Option("v", VALIDATE, NO_ARGS, "Validate the CityGML file."); validate.setArgName(VALIDATE); validate.setRequired(Boolean.FALSE); options.addOption(validate); try { CommandLine line = parser.parse(options, args); if (line.hasOption(INPUT) && line.hasOption(LEVEL_OF_DETAIL) && line.hasOption(GEOMETRY_TYPE) && line.hasOption(FORMAT)) { String inputValue = line.getOptionValue(INPUT); String levelOfDetailValue = line.getOptionValue(LEVEL_OF_DETAIL); String geometryTypeValue = line.getOptionValue(GEOMETRY_TYPE); String targetFormatValue = line.getOptionValue(FORMAT); String outputValue = line.getOptionValue(OUTPUT); LevelOfDetail lod = LevelOfDetail.valueOf(levelOfDetailValue); GeometryType type = GeometryType.valueOf(geometryTypeValue); if (Objects.isNull(lod) || Objects.isNull(type) || (!targetFormatValue.equals(X3D) && !targetFormatValue.equals(COLLADA))) { printHelp(options); } else { if (line.hasOption(VALIDATE)) { triggerValidation(inputValue); } if (targetFormatValue.equals(X3D)) { boolean splitValue = false; if (line.hasOption(SPLIT)) { splitValue = true; } if (Objects.isNull(outputValue) || outputValue.isEmpty()) { outputValue = inputValue + X3D_FILE_EXT; } triggerX3DConversion(inputValue, lod, type, outputValue, splitValue); } else if (targetFormatValue.equals(COLLADA)) { if (Objects.isNull(outputValue) || outputValue.isEmpty()) { outputValue = inputValue + COLLADA_FILE_EXT; } triggerColladaConversion(inputValue, lod, type, outputValue); } System.out.println("Conversion succeeded."); } } else { printHelp(options); } } catch (ParseException | IllegalArgumentException e) { printHelp(options); } catch (ValidationException e) { System.out.println("Input file is invalid. Operation canceled.\n" + e.getMessage()); } catch (ConversionException e) { String message = "Failed to convert CityGML."; if (Objects.nonNull(e.getMessage())) { message += " " + e.getMessage(); } System.out.println(message); } catch (IOException e) { System.out.println("Failed to read from file '" + input + "'."); } }
From source file:com.avego.oauth.migration.OauthDataMigrator.java
/** * This migrates spring security oauth 2 token data in m6 form to 1.0.5 release form * @param args// w ww .j a v a 2s . c om * @throws Exception */ public static void main(String[] args) throws Exception { if (args.length < 3) { System.err.println("Usage <db_jdbc_url> <db_user> <db_pw>"); System.err.println("Or <db_jdbc_url> <db_user> <db_pw>" + " <remove_refresh_tokens> <serialize_new_token_values> <oauth_access_token_table> <oauth_refresh_token_table>"); System.exit(1); } Boolean removeRefreshTokens = Boolean.FALSE; if (args.length > 3) { removeRefreshTokens = Boolean.parseBoolean(args[3]); } Boolean serializeNewTokenValues = Boolean.FALSE; if (args.length > 4) { serializeNewTokenValues = Boolean.parseBoolean(args[4]); } Map<String, Object> params = new HashMap<String, Object>(3); params.put(JdbcOauthMigrationDao.JDBC_URL_KEY, args[0]); params.put(JdbcOauthMigrationDao.USER_KEY, args[1]); params.put(JdbcOauthMigrationDao.PASS_KEY, args[2]); params.put(REMOVE_REFRESH_TOKENS_PARAM, removeRefreshTokens); params.put(SERIALIZE_NEW_TOKEN_VALUES_PARAM, serializeNewTokenValues); if (args.length > 5) { params.put(JdbcOauthMigrationDao.ACCESS_TOKEN_TABLE, args[5]); } if (args.length > 6) { params.put(JdbcOauthMigrationDao.REFRESH_TOKEN_TABLE, args[6]); } OauthDataMigrator migrator = new OauthDataMigrator(params); migrator.migrateData(); }
From source file:FileChooserDemo2.java
public static void main(String[] args) { // Schedule a job for the event dispatch thread: // creating and showing this application's GUI. SwingUtilities.invokeLater(new Runnable() { public void run() { // Turn off metal's use of bold fonts UIManager.put("swing.boldMetal", Boolean.FALSE); createAndShowGUI();/*from w w w . j a v a 2s.c om*/ } }); }
From source file:components.LabelDemo.java
public static void main(String[] args) { //Schedule a job for the event dispatch thread: //creating and showing this application's GUI. SwingUtilities.invokeLater(new Runnable() { public void run() { //Turn off metal's use of bold fonts UIManager.put("swing.boldMetal", Boolean.FALSE); createAndShowGUI();/*from w w w.j av a 2 s . c o m*/ } }); }
From source file:layout.BorderLayoutDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {/*from ww w .j a v a 2s . c om*/ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); //Schedule a job for the event dispatch thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }
From source file:DOM3.java
public static void main(String[] argv) { if (argv.length == 0) { printUsage();/*from w ww . j ava 2 s . co m*/ System.exit(1); } try { // get DOM Implementation using DOM Registry System.setProperty(DOMImplementationRegistry.PROPERTY, "org.apache.xerces.dom.DOMXSImplementationSourceImpl"); DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance(); DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation("LS"); // create DOMBuilder builder = impl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null); DOMConfiguration config = builder.getDomConfig(); // create Error Handler DOMErrorHandler errorHandler = new DOM3(); // create filter LSParserFilter filter = new DOM3(); builder.setFilter(filter); // set error handler config.setParameter("error-handler", errorHandler); // set validation feature // config.setParameter("validate", Boolean.FALSE); config.setParameter("validate", Boolean.TRUE); // set schema language config.setParameter("schema-type", "http://www.w3.org/2001/XMLSchema"); // config.setParameter("psvi",Boolean.TRUE); // config.setParameter("schema-type","http://www.w3.org/TR/REC-xml"); // set schema location config.setParameter("schema-location", "personal.xsd"); // parse document System.out.println("Parsing " + argv[0] + "..."); Document doc = builder.parseURI(argv[0]); // set error handler on the Document config = doc.getDomConfig(); config.setParameter("error-handler", errorHandler); // set validation feature config.setParameter("validate", Boolean.TRUE); config.setParameter("schema-type", "http://www.w3.org/2001/XMLSchema"); // config.setParameter("schema-type","http://www.w3.org/TR/REC-xml"); config.setParameter("schema-location", "data/personal.xsd"); // remove comments from the document config.setParameter("comments", Boolean.FALSE); System.out.println("Normalizing document... "); doc.normalizeDocument(); // create DOMWriter LSSerializer domWriter = impl.createLSSerializer(); System.out.println("Serializing document... "); config = domWriter.getDomConfig(); config.setParameter("xml-declaration", Boolean.FALSE); // config.setParameter("validate",errorHandler); // serialize document to standard output // domWriter.writeNode(System.out, doc); LSOutput dOut = impl.createLSOutput(); dOut.setByteStream(System.out); domWriter.write(doc, dOut); } catch (Exception ex) { ex.printStackTrace(); } }
From source file:layout.CardLayoutDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {//from w w w . j a va 2 s .co m //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); //Schedule a job for the event dispatch thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }
From source file:DataStructure.java
public static void main(String s[]) { DataStructure ds = new DataStructure(); System.out.println("printEven()"); ds.printEven();//from w w w .j a v a 2 s .c o m System.out.println("print(DataStructureIterator) with " + "getEvenIterator"); ds.print(ds.getEvenIterator()); System.out.println("print(DataStructureIterator) with " + "anonymous class, odd indicies"); ds.print(new DataStructure.DataStructureIterator() { private int nextIndex = 1; public boolean hasNext() { return (nextIndex <= ds.size() - 1); } public Integer next() { int retValue = ds.get(nextIndex); nextIndex += 2; return retValue; } }); System.out.println("print(Function) with lambda expressions"); ds.print(index -> { if (index % 2 == 0) return Boolean.TRUE; return Boolean.FALSE; }); ds.print(index -> { if (index % 2 == 0) return Boolean.FALSE; return Boolean.TRUE; }); System.out.println("print(Function) with method references"); ds.print(DataStructure::isEvenIndex); ds.print(DataStructure::isOddIndex); }
From source file:dnd.ChooseDropActionDemo.java
public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { //Turn off metal's use of bold fonts UIManager.put("swing.boldMetal", Boolean.FALSE); createAndShowGUI();// w ww .j av a 2s . co m } }); }
From source file:misc.DesktopDemo.java
public static void main(String args[]) { /* Use an appropriate Look and Feel */ try {/*from w w w . ja va2s . c om*/ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. SwingUtilities.invokeLater(new Runnable() { public void run() { new DesktopDemo().setVisible(true); } }); }