Examples of convert()


Examples of org.jboss.forge.addon.convert.CompositeConverter.convert()

               }
               else
               {
                  Converter<Object, String> stringConverter = converterFactory.getConverter(sourceType, String.class);
                  CompositeConverter compositeConverter = new CompositeConverter(stringConverter, valueConverter);
                  result = compositeConverter.convert(value);
               }

            }
            else
            {
View Full Code Here

Examples of org.jboss.forge.addon.convert.Converter.convert()

               {
                  if (choice != null)
                  {
                     Object itemLabel = choice.toString();
                     if (itemLabelConverter != null)
                        itemLabel = itemLabelConverter.convert(choice);
                     result.append("\"" + itemLabel + "\" ");
                  }
               }
               result.append("] ");
View Full Code Here

Examples of org.jboss.forge.convert.CompositeConverter.convert()

            }
            else
            {
               Converter<Object, String> stringConverter = converterFactory.getConverter(sourceType, String.class);
               CompositeConverter compositeConverter = new CompositeConverter(stringConverter, valueConverter);
               convertedType = compositeConverter.convert(value);
            }

         }
         else
         {
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request.convert()

    * @throws GeneralSecurityException
    */
   public Document sign(RequestAbstractType request, KeyPair keypair) throws SAXException, IOException, JAXBException, ParserConfigurationException, GeneralSecurityException, MarshalException, XMLSignatureException 
   {
      SAML2Request saml2Request = new SAML2Request();
      Document doc = saml2Request.convert(request);
      doc.normalize();
     
      String referenceURI = "#" + request.getID();
      
      return XMLSignatureUtil.sign(doc,
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.response.SAML2Response.convert()

      {
         SAML2Response saml2Response = new SAML2Response();
         PrivateKey privateKey = keyManager.getSigningKey();
        
         EncryptedElementType myEET = (EncryptedElementType) responseType.getAssertionOrEncryptedAssertion().get(0);
         Document eetDoc = saml2Response.convert(myEET);
        
         Element decryptedDocumentElement = XMLEncryptionUtil.decryptElementInDocument(eetDoc,privateKey);
        
         //Let us use the encrypted doc element to decrypt it
         return  saml2Response.getResponseType(DocumentUtil.getNodeAsStream(decryptedDocumentElement));   
View Full Code Here

Examples of org.jboss.seam.remoting.wrapper.BagWrapper.convert()

      e.addElement("element").addElement("str").addText(values[0]);
      e.addElement("element").addElement("str").addText(values[1]);
      wrapper.setElement(e);

      // String Array
      String[] converted = (String[]) wrapper.convert(String[].class);
      assert values.length == converted.length;
      assertEquals(values[0], converted[0]);
      assertEquals(values[1], converted[1]);

      // List
View Full Code Here

Examples of org.jboss.seam.remoting.wrapper.BooleanWrapper.convert()

   public void testBooleanWrapper() throws Exception
   {
      BooleanWrapper wrapper = new BooleanWrapper();
      wrapper.setElement(createElement("bool", Boolean.toString(true)));

      assert (Boolean) wrapper.convert(Boolean.class);
      assert (Boolean) wrapper.convert(Boolean.TYPE);

      try
      {
         // Try an invalid conversion
View Full Code Here

Examples of org.jboss.seam.remoting.wrapper.DateWrapper.convert()

      cal.set(Calendar.HOUR_OF_DAY, 12);
      cal.set(Calendar.MINUTE, 30);
      cal.set(Calendar.SECOND, 45);
      cal.set(Calendar.MILLISECOND, 150);

      assertEquals(cal.getTime(), wrapper.convert(Date.class));

      ByteArrayOutputStream out = new ByteArrayOutputStream();
      wrapper.marshal(out);

      byte[] expected = ("<date>" + value + "</date>").getBytes();
View Full Code Here

Examples of org.jboss.seam.remoting.wrapper.MapWrapper.convert()

      child.addElement("v").addElement("str").addText("zzzzz");

      wrapper.setElement(e);

      // Conversion tests
      Map m = (Map) wrapper.convert(Map.class);
      assert m.containsKey("foo");
      assert m.containsKey("bar");
      assert "aaaaa".equals(m.get("foo"));
      assert "zzzzz".equals(m.get("bar"));
View Full Code Here

Examples of org.jboss.seam.remoting.wrapper.NullWrapper.convert()

   @Test
   public void testNullWrapper() throws Exception
   {
      NullWrapper wrapper = new NullWrapper();
      assert wrapper.convert(null) == null;

      byte[] expected = "<null/>".getBytes();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      wrapper.marshal(out);
      assertEquals(expected, out.toByteArray());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.