/* * [NeedsJWS.java] * * Summary: expand the NeedsJava macro. * * Copyright: (c) 2009-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.8 2009-02-06 include go package in ZIP bundle. * 1.9 2012-11-11 renamed from NeedJWS to NeedsJWS. */ package com.mindprod.htmlmacros.macro; import com.mindprod.fastcat.FastCat; import static java.lang.System.*; /** * expand the NeedsJava macro. *

* * @author Roedy Green, Canadian Mind Products * @version 1.9 2012-11-11 renamed from NeedJWS to NeedsJWS. * @noinspection CanBeFinal, WeakerAccess * @since 2009 */ public final class NeedsJWS extends Macro { /** how to use the macro */ /** * how to use the macro */ private static final String USAGE = "\nNeedsJWS macro takes no parameters"; /** * guts to Generate reference to the JDK. * * @return expanded note if JWS ok or bad with adjusted link to repair html. * @noinspection WeakerAccess */ public String expand() { final FastCat sb = new FastCat( 2 ); sb.append( JavaScript.getJavaScriptContents( "ensurejwsinstalled.html" ) ); if ( fileBeingDistributed.getName().equals( "installingjws.html" ) ) { sb.append( "Here is how to repair any damage." ); } return sb.toString(); } /** * Expands: . * * @param parms none. * @param quiet true if want output suppressed. * @param verbose @return expanded macro HTML. */ public final String expandMacro( String[] parms, final boolean quiet, final boolean verbose ) { if ( !quiet ) { out.print( "J" ); } if ( parms.length != 0 ) { throw new IllegalArgumentException( USAGE ); } return expand(); } }