Tabnine Logo
BeanConverter.convertToObject
Code IndexAdd Tabnine to your IDE (free)

How to use
convertToObject
method
in
org.apache.shindig.protocol.conversion.BeanConverter

Best Java code snippets using org.apache.shindig.protocol.conversion.BeanConverter.convertToObject (Showing top 15 results out of 315)

origin: com.lmco.shindig/shindig-social-api

 public <T> T filterFields(JSONObject object, Set<String> fields,
              Class<T> clz) throws JSONException {
  if (!fields.isEmpty()) {
   // Create a copy with just the specified fields
   object = new JSONObject(object, fields.toArray(new String[fields
     .size()]));
  }
  return converter.convertToObject(object.toString(), clz);
 }
}
origin: org.apache.shindig/shindig-social-api

 public <T> T filterFields(JSONObject object, Set<String> fields,
              Class<T> clz) throws JSONException {
  if (!fields.isEmpty()) {
   // Create a copy with just the specified fields
   object = new JSONObject(object, fields.toArray(new String[fields
     .size()]));
  }
  String objectVal = object.toString();
  if (authority != null) {
   objectVal = objectVal.replace("%origin%", authority.getOrigin());
  } else {
   //provide default for junit tests
   objectVal = objectVal.replace("%origin%", "http://localhost:8080");
  }
  return converter.convertToObject(objectVal, clz);
 }
}
origin: org.wso2.org.apache.shindig/shindig-social-api

 public <T> T filterFields(JSONObject object, Set<String> fields,
              Class<T> clz) throws JSONException {
  if (!fields.isEmpty()) {
   // Create a copy with just the specified fields
   object = new JSONObject(object, fields.toArray(new String[fields
     .size()]));
  }
  String objectVal = object.toString();
  if (authority != null) {
   objectVal = objectVal.replace("%origin%", authority.getOrigin());
  } else {
   //provide default for junit tests
   objectVal = objectVal.replace("%origin%", "http://localhost:8080");
  }
  return converter.convertToObject(objectVal, clz);
 }
}
origin: org.gatein.shindig/shindig-common

public <T> T getTypedParameter(String parameterName, Class<T> dataTypeClass) {
 try {
  return converter.convertToObject(getParameter(parameterName), dataTypeClass);
 } catch (RuntimeException e) {
  if (e.getCause() instanceof JSONException)
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
  throw e;
 }
}
origin: com.lmco.shindig/shindig-common

public <T> T getTypedParameter(String parameterName, Class<T> dataTypeClass) {
 try {
  return converter.convertToObject(getParameter(parameterName), dataTypeClass);
 } catch (RuntimeException e) {
  if (e.getCause() instanceof JSONException)
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
  throw e;
 }
}
origin: org.apache.shindig/shindig-common

public <T> T getOptionalTypedParameter(String parameterName, Class<T> dataTypeClass) {
 try {
  String json = getParameter(parameterName);
  if (json == null) {
   return null;
  }
  return converter.convertToObject(json, dataTypeClass);
 } catch (RuntimeException e) {
  if (e.getCause() instanceof JSONException)
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
  throw e;
 }
}
origin: apache/shindig

public <T> T getOptionalTypedParameter(String parameterName, Class<T> dataTypeClass) {
 try {
  String json = getParameter(parameterName);
  if (json == null) {
   return null;
  }
  return converter.convertToObject(json, dataTypeClass);
 } catch (RuntimeException e) {
  if (e.getCause() instanceof JSONException)
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
  throw e;
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

public <T> T getOptionalTypedParameter(String parameterName, Class<T> dataTypeClass) {
 try {
  String json = getParameter(parameterName);
  if (json == null) {
   return null;
  }
  return converter.convertToObject(json, dataTypeClass);
 } catch (RuntimeException e) {
  if (e.getCause() instanceof JSONException)
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
  throw e;
 }
}
origin: apache/shindig

public <T> T getTypedParameter(String parameterName, Class<T> dataTypeClass) {
 try {
  String json = getParameter(parameterName);
  if (json == null) {
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "missing data for " + parameterName);
  }
  return converter.convertToObject(json, dataTypeClass);
 } catch (RuntimeException e) {
  if (e.getCause() instanceof JSONException)
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
  throw e;
 }
}
origin: org.apache.shindig/shindig-common

public <T> T getTypedParameter(String parameterName, Class<T> dataTypeClass) {
 try {
  String json = getParameter(parameterName);
  if (json == null) {
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "missing data for " + parameterName);
  }
  return converter.convertToObject(json, dataTypeClass);
 } catch (RuntimeException e) {
  if (e.getCause() instanceof JSONException)
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
  throw e;
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

public <T> T getTypedParameter(String parameterName, Class<T> dataTypeClass) {
 try {
  String json = getParameter(parameterName);
  if (json == null) {
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "missing data for " + parameterName);
  }
  return converter.convertToObject(json, dataTypeClass);
 } catch (RuntimeException e) {
  if (e.getCause() instanceof JSONException)
   throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
  throw e;
 }
}
origin: org.apache.shindig/shindig-social-api

try {
 clientJson = oauthDB.getJSONObject(clientId).getJSONObject("registration");
 OAuth2Client client = converter.convertToObject(clientJson.toString(), OAuth2Client.class);
 client.setType(clientJson.getString("type").equals("public") ? ClientType.PUBLIC : ClientType.CONFIDENTIAL);
 clients.add(client);
  JSONObject authCodes = clientJS.getJSONObject("authorizationCodes");
  for (String authCodeId : JSONObject.getNames(authCodes)) {
   OAuth2Code code = converter.convertToObject(authCodes
     .getJSONObject(authCodeId).toString(), OAuth2Code.class);
   code.setValue(authCodeId);
  JSONObject accessTokens = clientJS.getJSONObject("accessTokens");
  for (String accessTokenId : JSONObject.getNames(accessTokens)) {
   OAuth2Code code = converter.convertToObject(accessTokens.getJSONObject(accessTokenId).toString(), OAuth2Code.class);
   code.setValue(accessTokenId);
   code.setClient(client);
origin: org.wso2.org.apache.shindig/shindig-social-api

try {
 clientJson = oauthDB.getJSONObject(clientId).getJSONObject("registration");
 OAuth2Client client = converter.convertToObject(clientJson.toString(), OAuth2Client.class);
 client.setType(clientJson.getString("type").equals("public") ? ClientType.PUBLIC : ClientType.CONFIDENTIAL);
 clients.add(client);
  JSONObject authCodes = clientJS.getJSONObject("authorizationCodes");
  for (String authCodeId : JSONObject.getNames(authCodes)) {
   OAuth2Code code = converter.convertToObject(authCodes
     .getJSONObject(authCodeId).toString(), OAuth2Code.class);
   code.setValue(authCodeId);
  JSONObject accessTokens = clientJS.getJSONObject("accessTokens");
  for (String accessTokenId : JSONObject.getNames(accessTokens)) {
   OAuth2Code code = converter.convertToObject(accessTokens.getJSONObject(accessTokenId).toString(), OAuth2Code.class);
   code.setValue(accessTokenId);
   code.setClient(client);
origin: org.wso2.org.apache.shindig/shindig-social-api

return Futures.immediateFuture(converter.convertToObject(curPerson.toString(), Person.class));
origin: org.apache.shindig/shindig-social-api

return Futures.immediateFuture(converter.convertToObject(curPerson.toString(), Person.class));
org.apache.shindig.protocol.conversionBeanConverterconvertToObject

Popular methods of BeanConverter

  • convertToString
  • getContentType
  • append
    Serialize object to a buffer. Useful for high performance output.

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • getApplicationContext (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for WebStorm
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