Tabnine Logo
org.kie.server.api.marshalling
Code IndexAdd Tabnine to your IDE (free)

How to use org.kie.server.api.marshalling

Best Java code snippets using org.kie.server.api.marshalling (Showing top 20 results out of 315)

origin: org.kie.server/kie-server-services-common

public static MarshallingFormat getFormat(String descriptor) {
  MarshallingFormat format = MarshallingFormat.fromType(descriptor);
  if (format == null) {
    format = MarshallingFormat.valueOf(descriptor);
  }
  return format;
}

origin: kiegroup/droolsjbpm-integration

/**
 * Builds new marshaller for given format and class loader
 * @param format marshaller format that marshaller should be built for
 * @param classLoader classloader to be used by the marshaller
 * @return new instance of the marshaller
 */
public static Marshaller getMarshaller(MarshallingFormat format, ClassLoader classLoader) {
  return getMarshaller(null, format, classLoader);
}
origin: kiegroup/droolsjbpm-integration

/**
 * Builds new marshaller for given format and class loader
 * @param classes optional custom classes to be added to marshaller - might be null
 * @param format marshaller format that marshaller should be built for
 * @param classLoader classloader to be used by the marshaller
 * @return new instance of the marshaller
 */
public static Marshaller getMarshaller(Set<Class<?>> classes, MarshallingFormat format, ClassLoader classLoader) {
  return builder.build(classes, format, classLoader);
}
origin: org.kie.server/kie-server-services-common

protected String serialize(Object object) {
  if (object == null) {
    return "";
  }
  try {
    return MarshallerFactory.getMarshaller(MarshallingFormat.JSON, this.getClass().getClassLoader()).marshall(object);
  } catch ( MarshallingException e ) {
    throw new IllegalStateException( "Error while serializing request data!", e );
  }
}
origin: org.kie.server/kie-server-controller-client

  protected <T> T deserialize(String content, Class<T> type) {
    return marshaller.unmarshall( content, type );
  }
}
origin: org.kie.server/kie-server-controller-websocket-client

protected String serialize(Object object) {
  if (object == null) {
    return "";
  }
  try {
    return marshaller.marshall(object);
  } catch ( MarshallingException e ) {
    throw new IllegalStateException( "Error while serializing request data!", e );
  }
}
origin: kiegroup/droolsjbpm-integration

  @Override
  public Marshaller build(Set<Class<?>> classes, MarshallingFormat format, ClassLoader classLoader) {

    if (format.equals(MarshallingFormat.XSTREAM)) {

      return new XStreamMarshaller(classes, classLoader) {
        @Override
        protected void buildMarshaller(Set<Class<?>> classes, ClassLoader classLoader) {
          xstream = XStreamUtils.createNonTrustingXStream(new PureJavaReflectionProvider(), new DomDriver("UTF-8", new XmlFriendlyNameCoder("_-", "_")));
          xstream.addPermission(new WildcardTypePermission(new String[]{"org.kie.server.api.**"}));
          String[] voidDeny = {"void.class", "Void.class"};
          xstream.denyTypes(voidDeny);
        }
      };
    }

    return super.build(classes, format, classLoader);
  }
}
origin: org.kie/kie-server-services

public void disposeMarshallers() {
  synchronized ( marshallers ) {
    for ( Marshaller marshaller : this.marshallers.values() ) {
      marshaller.dispose();
    }
    this.marshallers.clear();
  }
}
origin: kiegroup/droolsjbpm-integration

public static Object wrap(Object object) {
  if (object != null && isPrimitiveOrWrapper(object.getClass())) {
    return wrapPrimitive(object);
  }
  return wrapSkipPrimitives(object);
}
origin: org.kie/kie-server-api

@Override
public String marshall(Object objectInput) {
  try {
    return objectMapper.writeValueAsString(objectInput);
  } catch (IOException e) {
    throw new MarshallingException("Error marshalling input", e);
  }
}
origin: org.kie.server/kie-server-client

@Override
public ClassLoader getClassLoader() {
  return this.marshaller.getClassLoader();
}
origin: org.kie.server/kie-server-client

@Override
public void setClassLoader(ClassLoader classLoader) {
  this.marshaller.setClassLoader(classLoader);
}
origin: kiegroup/droolsjbpm-integration

public JaxbList(List<Object> items) {
  this.items = items.toArray();
  int index = 0;
  for (Object o : this.items) {
    this.items[index] = ModelWrapper.wrapSkipPrimitives(o);
    index++;
  }
}
origin: org.kie/kie-server-client

private <T> T deserialize(String content, Class<T> type) {
  try {
    return marshaller.unmarshall( content, type );
  } catch ( MarshallingException e ) {
    throw new KieServicesException( "Error while deserializing data received from server!", e );
  }
}
origin: org.kie.server/kie-server-client

protected String serialize(Object object) {
  if (object == null) {
    return "";
  }
  try {
    return marshaller.marshall( object );
  } catch ( MarshallingException e ) {
    throw new KieServicesException( "Error while serializing request data!", e );
  }
}
origin: org.kie.server/kie-server-controller-rest

public static MarshallingFormat getFormat(String descriptor) {
  MarshallingFormat format = MarshallingFormat.fromType(descriptor);
  if (format == null) {
    format = MarshallingFormat.valueOf(descriptor);
  }
  return format;
}
origin: org.kie.server/kie-server-services-common

public void disposeMarshallers() {
  synchronized ( marshallers ) {
    for ( Marshaller marshaller : this.marshallers.values() ) {
      marshaller.dispose();
    }
    this.marshallers.clear();
  }
}
origin: org.kie/kie-server-api

@Override
public <T> T unmarshall(String serializedInput, Class<T> type) {
  try {
    return objectMapper.readValue(serializedInput, type);
  } catch (IOException e) {
    throw new MarshallingException("Error unmarshalling input", e);
  }
}
origin: kiegroup/droolsjbpm-integration

 @AfterClass
 public static void teardown() {
  xStreamMarshaller.dispose();
  jaxbMarshaller.dispose();
  jsonMarshaller.dispose();
 }
}
origin: org.kie/kie-server-api

public JaxbMarshaller() {
  try {
    this.jaxbContext = JAXBContext.newInstance( KIE_SERVER_JAXB_CLASSES );
    this.marshaller = jaxbContext.createMarshaller();
    this.unmarshaller = jaxbContext.createUnmarshaller();
  } catch ( JAXBException e ) {
    throw new MarshallingException( "Error while creating JAXB context from default classes!", e );
  }
}
org.kie.server.api.marshalling

Most used classes

  • Marshaller
    These Marshallers implementations must be thread-safe
  • MarshallerFactory
  • MarshallingFormat
  • XStreamMarshaller
  • ModelWrapper
  • MarshallingException,
  • JaxbMarshaller,
  • JSONMarshaller,
  • StringContentCaseFile,
  • StringContentMap,
  • PojoA,
  • KieServerTypePermission,
  • DecisionMarshallingTest,
  • JSONMarshallerTest$Holder,
  • JSONMarshallerTest$Ref,
  • MarshallerBuilder,
  • ScoresMarshallingTest,
  • JSONMarshaller$3,
  • JSONMarshaller$CustomAsWrapperTypeDeserializer
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now