/** * Constructs a new LocalizedMessage using <code>resource</code> as the base name for the * RessourceBundle and <code>id</code> as the message bundle id the resource file. * @param resource base name of the resource file * @param id the id of the corresponding bundle in the resource file * @param encoding the encoding of the resource file * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code> * @throws UnsupportedEncodingException if the encoding is not supported */ public LocalizedMessage(String resource,String id, String encoding) throws NullPointerException, UnsupportedEncodingException { if (resource == null || id == null) { throw new NullPointerException(); } this.id = id; this.resource = resource; arguments = new FilteredArguments(); if (!Charset.isSupported(encoding)) { throw new UnsupportedEncodingException("The encoding \"" + encoding + "\" is not supported."); } this.encoding = encoding; }
/** * Constructs a new LocalizedMessage using <code>resource</code> as the base name for the * RessourceBundle and <code>id</code> as the message bundle id the resource file. * @param resource base name of the resource file * @param id the id of the corresponding bundle in the resource file * @param encoding the encoding of the resource file * @param arguments an array containing the arguments for the message * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code> * @throws UnsupportedEncodingException if the encoding is not supported */ public LocalizedMessage(String resource, String id, String encoding, Object[] arguments) throws NullPointerException, UnsupportedEncodingException { if (resource == null || id == null || arguments == null) { throw new NullPointerException(); } this.id = id; this.resource = resource; this.arguments = new FilteredArguments(arguments); if (!Charset.isSupported(encoding)) { throw new UnsupportedEncodingException("The encoding \"" + encoding + "\" is not supported."); } this.encoding = encoding; }
/** * Constructs a new LocalizedMessage using <code>resource</code> as the base name for the * RessourceBundle and <code>id</code> as the message bundle id the resource file. * @param resource base name of the resource file * @param id the id of the corresponding bundle in the resource file * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code> */ public LocalizedMessage(String resource,String id) throws NullPointerException { if (resource == null || id == null) { throw new NullPointerException(); } this.id = id; this.resource = resource; arguments = new FilteredArguments(); }
/** * Constructs a new LocalizedMessage using <code>resource</code> as the base name for the * RessourceBundle and <code>id</code> as the message bundle id the resource file. * @param resource base name of the resource file * @param id the id of the corresponding bundle in the resource file * @param arguments an array containing the arguments for the message * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code> */ public LocalizedMessage(String resource, String id, Object[] arguments) throws NullPointerException { if (resource == null || id == null || arguments == null) { throw new NullPointerException(); } this.id = id; this.resource = resource; this.arguments = new FilteredArguments(arguments); }
/** * * @param extraArgs */ public void setExtraArguments(Object[] extraArgs) { if (extraArgs != null) { this.extraArgs = new FilteredArguments(extraArgs); this.extraArgs.setFilter(filter); } else { this.extraArgs = null; } }