Community articlesetLiteralEx method (Streaming API)
Added by IBM contributorIBM on August 16, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars




Description

This method sets the literal of a node. You should only set the literal for option or argument nodes.
Note: It is not necessary to call this method when you are using XForms. Use the updateXFormsInstance method instead.

Method

   public void setLiteralEx(
      String theCharSet,
      String theLiteral
      ) throws UWIException;


Parameters

ExpressionTypeDescription
theCharSetStringThe character set in which theLiteral parameter is written. Use null or Unicode for Unicode.
theLiteralStringThe literal to assign to the node. If null, any existing literal is removed.


Returns

Nothing if call is successful or throws a generic exception (UWIException) if an error occurs.

Notes

Digital signatures:
Do not set the literal of a node that has already been signed. Doing so will break the digital signature and produce an error.

Example

In the following example, dereferenceEx is used to locate a specific node. setLiteralEx is then used to change the literal of that node.
   private static void changeNameLabel(FormNodeP theForm, String newName)
      throws Exception
   {
   FormNodeP tempNode;
 
      if ((tempNode = theForm.dereferenceEx(null, "PAGE1.NAMELABEL.value", 
         0, FormNodeP.UFL_OPTION_REFERENCE | FormNodeP.UFL_SEARCH, null)) == 
         null)
      {
         throw new UWIException("Could not locate value node for
            NAMELABEL.");
      }
      tempNode.setLiteralEx(null, newName);
   }


Parent topic:
FormNodeP class