Examples of MapperException


Examples of com.sdicons.json.mapper.MapperException

    static boolean getBooleanRequired(final JSONObject jsonObject, final String name,
      final String errorMessage) throws MapperException {
  final JSONValue fromJsonValue = jsonObject.get(name);
  if (fromJsonValue == null) {
      throw new MapperException(errorMessage);
  } else {
      return (Boolean) JSONMapper.toJava(fromJsonValue, Boolean.class);
  }
    }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

        "AjLegoBox property separator was not found in json data"));
      out.setTags(Helper.getStringRequired(jsonObject, "tags",
        "AjLegoBox property tags was not found in json data"));
      return out;
  }
  throw new MapperException("AjPropertyValue cannot map: " + aValue.getClass().getName());
    }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

        "AjPageable property rowCount was not found in json data"));
      out.setRowPerPage(Helper.getIntRequired(jsonObject, "rowPerPage",
        "AjPageable property rowPerPage was not found in json data"));
      JSONValue list = jsonObject.get("currentPage");
      if (list == null) {
    throw new MapperException(
      "AjPageable property currentPage was not found in json data");
      } else {
    out.setCurrentPage(new ArrayList<AjLegoBox>());
    JSONArray array = (JSONArray) list;
    for (JSONValue jsonValue : array.getValue()) {
        out.getCurrentPage().add(
          (AjLegoBox) JSONMapper.toJava(jsonValue, AjLegoBox.class));
    }

      }
      return out;
  }
  throw new MapperException("AjPropertyValue cannot map: " + aValue.getClass().getName());
    }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

          (Integer) JSONMapper.toJava(jsonValue, Integer.class));
    }
      }
      return out;
  }
  throw new MapperException("BooleanMapper cannot map: " + aValue.getClass().getName());
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.client.mapper.MapperException

                properties.put(PropertyIds.OBJECT_TYPE_ID, CFG.getDefaultDocumentType());
            } else {
                parser.reset();
                PropertyMapper mapper = CFG.getPropertyMapper(mimeType);
                if (null == mapper)
                    throw new MapperException("Unknown mime type (no configuration): " + mimeType);
                String typeId = mapper.getMappedTypeId();
                if (null == typeId)
                    throw new MapperException("No CMIS type configured for mime type" + mimeType);
                TypeDefinition td = session.getTypeDefinition(typeId);
                if (null == td)
                    throw new MapperException("CMIS type " + typeId + " does not exist on server.");

                LOG.info("Detected MIME type: "+ mimeType + " is mapped to CMIS type id: " + td.getId());
                parser.extractMetadata(f, td);
                properties = parser.getCmisProperties();
            }
View Full Code Here

Examples of org.apache.chemistry.opencmis.client.mapper.MapperException

                MetadataParserTika mpt = new MetadataParserTika();
                mpt.listMetadata(f);
            } else {
                PropertyMapper mapper = CFG.getPropertyMapper(mimeType);
                if (null == mapper)
                    throw new MapperException("Unknown mime type (no configuration): " + mimeType);
                String typeId = mapper.getMappedTypeId();
                if (null == typeId)
                    throw new MapperException("No CMIS type configured for mime type" + mimeType);
               
                // Session available? if yes do conversion
                TypeDefinition td = null;
                if (null!= session) {
                    session.getTypeDefinition(typeId);
                    if (null == td)
                        throw new MapperException("CMIS type " + typeId + " does not exist on server.");
                }
                LOG.info("Detected MIME type: "+ mimeType + " is mapped to CMIS type id: " + td.getId());
               
                parser.extractMetadata(f, td);
                Map<String, Object> properties = parser.getCmisProperties();
View Full Code Here

Examples of org.apache.chemistry.opencmis.client.mapper.MapperException

        String typeId = mapper.getMappedTypeId();
        cmisProperties = new HashMap<String, Object>();
        mapper.reset();

        if (null == typeId)
            throw new MapperException("No CMIS Type configured in this parser.");
        cmisProperties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.client.mapper.MapperException

                    String propertyId = mapper.getMappedPropertyId(key);
                    if (null != propertyId && null != val) {
                        if (td != null) {
                            PropertyDefinition<?> propDef = td.getPropertyDefinitions().get(propertyId);
                            if (null == propDef)
                                throw new MapperException("Mapping error: unknown property "+ propertyId + " in type definition " + td.getId());
                            PropertyType propertyType = propDef.getPropertyType();
                            Object convVal = mapper.convertValue(propertyId, propDef, val);
                            if (null != convVal)
                                cmisProperties.put(propertyId, convVal);
                        } else
                            cmisProperties.put(propertyId, val); // omit conversion if no type definition is available
                    }
                }
            }

        } catch (Exception e) {
            LOG.error(e);
            throw new MapperException("Extracting metadata failed for file " + f.getAbsolutePath(), e);
        }
    }   
View Full Code Here

Examples of org.apache.chemistry.opencmis.client.mapper.MapperException

                LOG.info("Found metadata \'" + key + "\': " + val);     
            }

        } catch (Exception e) {
            LOG.error(e);
            throw new MapperException("Extracting metadata failed, file not found: " + f.getAbsolutePath(), e);
        }
    }
View Full Code Here

Examples of speculoos.core.MapperException

    if (_filter == null && filter != null) {
      filter.map(input, env);
      _filter = (String) env.get("filter");
    }
    if (_filter == null)
      throw new MapperException(getName()
          + ": No filter definable for this search");
    /* control */
    SearchControls controls = new SearchControls();
    controls.setSearchScope(SearchControls.OBJECT_SCOPE);
    controls.setReturningAttributes(new String[0]);
    controls.setReturningObjFlag(true);
    /* run query */
    try {
      if (log.isDebugEnabled())
        log.debug("[" + getName() + "] comparing " + _root + " with "
            + _filter);
      directory.search(_root, _filter, controls);
      if (log.isDebugEnabled())
        log.debug("[" + getName() + "] done");
    } catch (NamingException ne) {
      throw new MapperException("Failed to match requested attributes",
          ne);
    }
    return Boolean.TRUE;
  }
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.