Codota Logo
FormEncodingFactory.getEncoder
Code IndexAdd Codota to your IDE (free)

How to use
getEncoder
method
in
org.jbpm.form.builder.services.model.forms.FormEncodingFactory

Best Java code snippets using org.jbpm.form.builder.services.model.forms.FormEncodingFactory.getEncoder (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.jbpm/form-services

private void writeMenuItems(Map<String, List<MenuItemDescription>> items) throws MenuServiceException {
  try {
    FormRepresentationEncoder encoder = FormEncodingFactory.getEncoder();
    String json = encoder.encodeMenuItemsMap(items);
    URL url = asURL("/menuItems.json");
    writeToURL(url, json);
  } catch (FormEncodingException e) {
    throw new MenuServiceException("Problem transforming menu items to json", e);
  } catch (URISyntaxException e) {
    throw new MenuServiceException("Problem finding menu items json file", e);
  } catch (FileNotFoundException e) {
    throw new MenuServiceException("No menu items json file found", e);
  } catch (IOException e) {
    throw new MenuServiceException("Problem writing menu items json file", e);
  } catch (Exception e) {
    throw new MenuServiceException("Unexpected error", e);
  }
}
origin: org.jbpm/jbpm-form-services

private void writeMenuItems(Map<String, List<MenuItemDescription>> items) throws MenuServiceException {
  try {
    FormRepresentationEncoder encoder = FormEncodingFactory.getEncoder();
    String json = encoder.encodeMenuItemsMap(items);
    URL url = asURL("/menuItems.json");
    writeToURL(url, json);
  } catch (FormEncodingException e) {
    throw new MenuServiceException("Problem transforming menu items to json", e);
  } catch (URISyntaxException e) {
    throw new MenuServiceException("Problem finding menu items json file", e);
  } catch (FileNotFoundException e) {
    throw new MenuServiceException("No menu items json file found", e);
  } catch (IOException e) {
    throw new MenuServiceException("Problem writing menu items json file", e);
  } catch (Exception e) {
    throw new MenuServiceException("Unexpected error", e);
  }
}
origin: org.jbpm/jbpm-form-services

@Test
public void testListItemsEncodingProblem() throws Exception {
  FSMenuService service = createMockedService(null);
  FormRepresentationDecoder decoder = EasyMock.createMock(FormRepresentationDecoder.class);
  FormEncodingFactory.register(FormEncodingFactory.getEncoder(), decoder);
  FormEncodingException exception = new FormEncodingException("Something going wrong");
  EasyMock.expect(decoder.decodeMenuItemsMap(EasyMock.anyObject(String.class))).andThrow(exception).once();
  
  EasyMock.replay(decoder);
  try {
    service.listMenuItems();
    fail("listOptions shouldn't succeed");
  } catch (MenuServiceException e) {
    assertNotNull("e shouldn't be null", e);
    Throwable cause = e.getCause();
    assertNotNull("cause shouldn't be null", cause);
    assertTrue("cause should be a FormEncodingException", cause instanceof FormEncodingException);
  }
  EasyMock.verify(decoder);
}
@Test
origin: org.jbpm/form-services

@Test
public void testListItemsEncodingProblem() throws Exception {
  FSMenuService service = createMockedService(null);
  FormRepresentationDecoder decoder = EasyMock.createMock(FormRepresentationDecoder.class);
  FormEncodingFactory.register(FormEncodingFactory.getEncoder(), decoder);
  FormEncodingException exception = new FormEncodingException("Something going wrong");
  EasyMock.expect(decoder.decodeMenuItemsMap(EasyMock.anyObject(String.class))).andThrow(exception).once();
  
  EasyMock.replay(decoder);
  try {
    service.listMenuItems();
    fail("listOptions shouldn't succeed");
  } catch (MenuServiceException e) {
    assertNotNull("e shouldn't be null", e);
    Throwable cause = e.getCause();
    assertNotNull("cause shouldn't be null", cause);
    assertTrue("cause should be a FormEncodingException", cause instanceof FormEncodingException);
  }
  EasyMock.verify(decoder);
}
@Test
org.jbpm.form.builder.services.model.formsFormEncodingFactorygetEncoder

Popular methods of FormEncodingFactory

  • getDecoder
  • register

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Reference (javax.naming)
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • JCheckBox (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now