Examples of BeanDescription


Examples of com.fasterxml.jackson.databind.BeanDescription

            name = _typeToId.get(key);
            if (name == null) {
                // 24-Feb-2011, tatu: As per [JACKSON-498], may need to dynamically look up name
                // can either throw an exception, or use default name...
                if (_config.isAnnotationProcessingEnabled()) {
                    BeanDescription beanDesc = _config.introspectClassAnnotations(cls);
                    name = _config.getAnnotationIntrospector().findTypeName(beanDesc.getClassInfo());
                }
                if (name == null) {
                    // And if still not found, let's choose default?
                    name = _defaultTypeId(cls);
                }
View Full Code Here

Examples of com.fasterxml.jackson.databind.BeanDescription

                                         Object beanOrClass,
                                         String propertyName) throws IOException, JsonProcessingException {
        ObjectCodec objectCodec = jp.getCodec();
        if (objectCodec instanceof ObjectMapper) {
            ObjectMapper objectMapper = (ObjectMapper) objectCodec;
            BeanDescription beanDescription =
                    objectMapper.getSerializationConfig().introspect(ctxt.constructType(beanOrClass.getClass()));
            for (BeanPropertyDefinition propertyDefinition : beanDescription.findProperties()) {
                if (propertyName.equals(propertyDefinition.getName())) {
                    jp.skipChildren();
                    return true;
                }
            }
View Full Code Here

Examples of com.fasterxml.jackson.databind.BeanDescription

  @Override
  public Iterable<? extends ModelProperty> propertiesForSerialization(ResolvedType resolvedType) {
    List<ModelProperty> serializationCandidates = newArrayList();
    SerializationConfig serializationConfig = objectMapper.getSerializationConfig();
    BeanDescription beanDescription = serializationConfig.introspect(TypeFactory.defaultInstance()
            .constructType(resolvedType.getErasedType()));
    Map<String, BeanPropertyDefinition> propertyLookup = Maps.uniqueIndex(beanDescription.findProperties(),
            BeanPropertyDefinitions.beanPropertyByInternalName());

    for (ResolvedField childField : fieldProvider.in(resolvedType)) {
      if (propertyLookup.containsKey(childField.getName())) {
        BeanPropertyDefinition propertyDefinition = propertyLookup.get(childField.getName());
View Full Code Here

Examples of com.fasterxml.jackson.databind.BeanDescription

  @Override
  public Iterable<? extends ModelProperty> propertiesForDeserialization(ResolvedType resolvedType) {
    List<ModelProperty> serializationCandidates = newArrayList();
    DeserializationConfig serializationConfig = objectMapper.getDeserializationConfig();
    BeanDescription beanDescription = serializationConfig.introspect(TypeFactory.defaultInstance()
            .constructType(resolvedType.getErasedType()));
    Map<String, BeanPropertyDefinition> propertyLookup = uniqueIndex(beanDescription.findProperties(),
            BeanPropertyDefinitions.beanPropertyByInternalName());
    for (ResolvedField childField : fieldProvider.in(resolvedType)) {
      if (propertyLookup.containsKey(childField.getName())) {
        BeanPropertyDefinition propertyDefinition = propertyLookup.get(childField.getName());
        Optional<BeanPropertyDefinition> jacksonProperty
View Full Code Here

Examples of com.fasterxml.jackson.databind.BeanDescription

  @Override
  public Iterable<? extends ModelProperty> propertiesForSerialization(ResolvedType resolvedType) {
    List<ModelProperty> serializationCandidates = newArrayList();
    SerializationConfig serializationConfig = objectMapper.getSerializationConfig();
    BeanDescription beanDescription = serializationConfig.introspect(TypeFactory.defaultInstance()
            .constructType(resolvedType.getErasedType()));
    Map<String, BeanPropertyDefinition> propertyLookup = uniqueIndex(beanDescription.findProperties(),
            BeanPropertyDefinitions.beanPropertyByInternalName());
    for (ResolvedMethod childProperty : accessors.in(resolvedType)) {
      if (propertyLookup.containsKey(propertyName(childProperty.getName()))) {
        BeanPropertyDefinition propertyDefinition = propertyLookup.get(propertyName(childProperty.getName()));
        Optional<BeanPropertyDefinition> jacksonProperty
View Full Code Here

Examples of com.fasterxml.jackson.databind.BeanDescription

  @Override
  public Iterable<? extends ModelProperty> propertiesForDeserialization(ResolvedType resolvedType) {
    List<ModelProperty> serializationCandidates = newArrayList();
    DeserializationConfig serializationConfig = objectMapper.getDeserializationConfig();
    BeanDescription beanDescription = serializationConfig.introspect(TypeFactory.defaultInstance()
            .constructType(resolvedType.getErasedType()));
    Map<String, BeanPropertyDefinition> propertyLookup = uniqueIndex(beanDescription.findProperties(),
            BeanPropertyDefinitions.beanPropertyByInternalName());
    for (ResolvedMethod childProperty : accessors.in(resolvedType)) {

      if (propertyLookup.containsKey(propertyName(childProperty.getName()))) {
        BeanPropertyDefinition propertyDefinition = propertyLookup.get(propertyName(childProperty.getName()));
View Full Code Here

Examples of org.openengsb.core.api.model.BeanDescription

     * @return a SecureRequest corresponding to the given ServiceId and MethodId
     */
    private MethodCallMessage createSecureRequest(ServiceId serviceId, MethodId methodId)
        throws ArgumentConversionException {
        MethodCallMessage methodCallRequest = createMethodCallRequest(serviceId, methodId);
        BeanDescription beanDescription = BeanDescription.fromObject(new Password("yourpassword"));
        methodCallRequest.setPrincipal("yourusername");
        methodCallRequest.setCredentials(beanDescription);
        return methodCallRequest;
    }
View Full Code Here

Examples of org.openengsb.core.api.model.BeanDescription

        return publicKey;
    }

    private static byte[] marshalSecureRequest(MethodCallMessage methodCallRequest,
            String username, Object credentials) throws IOException {
        BeanDescription credentialsBean = BeanDescription.fromObject(credentials);
        methodCallRequest.setPrincipal(username);
        methodCallRequest.setCredentials(credentialsBean);
        return MAPPER.writeValueAsBytes(methodCallRequest);
    }
View Full Code Here

Examples of org.openengsb.core.api.model.BeanDescription

        return convertStringToResult(resultString);
    }

    private static String marshalSecureRequest(MethodCallMessage methodCallRequest,
            String username, Object credentails) throws IOException {
        BeanDescription auth = BeanDescription.fromObject(credentails);
        methodCallRequest.setPrincipal(username);
        methodCallRequest.setCredentials(auth);
        return MAPPER.writeValueAsString(methodCallRequest);
    }
View Full Code Here

Examples of org.openengsb.core.api.model.BeanDescription

        MethodCall methodCall = new MethodCall("createWithId", new Object[]{ connectorId, connectorDescription });
        Map<String, String> metaData = new HashMap<String, String>();
        metaData.put("serviceId", "connectorManager");
        methodCall.setMetaData(metaData);
        MethodCallMessage methodCallRequest = new MethodCallMessage(methodCall, false);
        BeanDescription auth = BeanDescription.fromObject(new Password("password"));
        methodCallRequest.setPrincipal("admin");
        methodCallRequest.setCredentials(auth);

        ObjectMapper mapper = new ObjectMapper();
        return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(methodCallRequest);
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.