boolean useConverterSPI, ReferenceContext context) throws ReferenceServiceException { checkServices(); context = EmptyReferenceContext.checkContext(context); if (useConverterSPI) { checkConverterRegistry(); return getNameForObject(o, targetDepth, useConverterSPI, context);
public Object renderIdentifier(T2Reference id, Class<?> leafClass, ReferenceContext context) throws ReferenceServiceException { checkServices(); return renderIdentifierInner(id, leafClass, context, converter);
public boolean delete(List<T2Reference> references) throws ReferenceServiceException { boolean result=true; for (T2Reference reference : references) { delete(reference); } return result; }
checkServices(); if (desiredDepth < 0) { throw new ReferenceServiceException( case IdentifiedList: try { List<T2Reference> children = getListService().getList( ref); int position = 0; for (T2Reference child : children) { newSet.add(new ContextualizedT2ReferenceImpl(child, addIndex(ci.getIndex(), position++))); case ErrorDocument: newSet.add(new ContextualizedT2ReferenceImpl(ref .getDeeperErrorReference(), addIndex(ci.getIndex(), 0))); break;
Set<Class<ExternalReferenceSPI>> ensureTypes, ReferenceContext context) throws ReferenceServiceException { checkServices(); context = EmptyReferenceContext.checkContext(context); switch (id.getReferenceType()) { newList.add(resolveIdentifier(item, ensureTypes, context));
private static ReferenceService createReferenceService() { SimpleT2ReferenceGenerator referenceGenerator = new SimpleT2ReferenceGenerator(); ReferenceSetAugmentorImpl referenceSetAugmentor = new ReferenceSetAugmentorImpl(); referenceSetAugmentor.setBuilders((List<ExternalReferenceBuilderSPI<?>>) getBuilders()); referenceSetAugmentor.setTranslators(getTranslators()); ReferenceSetServiceImpl referenceSetService = new ReferenceSetServiceImpl(); referenceSetService.setT2ReferenceGenerator(referenceGenerator); referenceSetService.setReferenceSetDao(new InMemoryReferenceSetDao()); referenceSetService.setReferenceSetAugmentor(referenceSetAugmentor); ListServiceImpl listService = new ListServiceImpl(); listService.setT2ReferenceGenerator(referenceGenerator); listService.setListDao(new InMemoryListDao()); ErrorDocumentServiceImpl errorDocumentService = new ErrorDocumentServiceImpl(); errorDocumentService.setT2ReferenceGenerator(referenceGenerator); errorDocumentService.setErrorDao(new InMemoryErrorDocumentDao()); ReferenceServiceImpl referenceService = new ReferenceServiceImpl(); referenceService.setReferenceSetService(referenceSetService); referenceService.setListService(listService); referenceService.setErrorDocumentService(errorDocumentService); referenceService.setConverters(getConverters()); referenceService.setValueBuilders(getValueBuilders()); return referenceService; }
references.add(getNameForObject(item, currentDepth - 1, useConverterSPI, context));
checkServices(); if (desiredDepth < 0) { throw new ReferenceServiceException( case IdentifiedList: try { List<T2Reference> children = getListService().getList( ref); int position = 0; for (T2Reference child : children) { newSet.add(new ContextualizedT2ReferenceImpl(child, addIndex(ci.getIndex(), position++))); case ErrorDocument: newSet.add(new ContextualizedT2ReferenceImpl(ref .getDeeperErrorReference(), addIndex(ci.getIndex(), 0))); break;
Set<Class<ExternalReferenceSPI>> ensureTypes, ReferenceContext context) throws ReferenceServiceException { checkServices(); if (context == null) { context = new EmptyReferenceContext(); newList.add(resolveIdentifier(item, ensureTypes, context));
references.add(getNameForObject(item, currentDepth - 1, useConverterSPI, context));
checkServices(); if (desiredDepth < 0) { throw new ReferenceServiceException( case IdentifiedList: try { List<T2Reference> children = getListService().getList( ref); int position = 0; for (T2Reference child : children) { newSet.add(new ContextualizedT2ReferenceImpl(child, addIndex(ci.getIndex(), position++))); case ErrorDocument: newSet.add(new ContextualizedT2ReferenceImpl(ref .getDeeperErrorReference(), addIndex(ci.getIndex(), 0))); break;
boolean useConverterSPI, ReferenceContext context) throws ReferenceServiceException { checkServices(); if (context == null) { context = new EmptyReferenceContext(); checkConverterRegistry(); return getNameForObject(o, targetDepth, useConverterSPI, context);
public Object renderIdentifier(T2Reference id, Class<?> leafClass, ReferenceContext context) throws ReferenceServiceException { // Check we have the services installed checkServices(); // Insert an empty context if context was null context = EmptyReferenceContext.checkContext(context); // Reject if the source reference contains errors if (id.containsErrors()) { throw new ReferenceServiceException( "Can't render an identifier which contains errors to a POJO"); } // Attempt to find an appropriate StreamToValueConverterSPI instance to // build the specified class StreamToValueConverterSPI<?> converter = null; if (valueBuilderRegistry != null) { for (StreamToValueConverterSPI<?> stvc : valueBuilderRegistry) { Class<?> builtClass = stvc.getPojoClass(); if (leafClass.isAssignableFrom(builtClass)) { converter = stvc; break; } } } if (converter == null) { log.warn("No stream->value converters found for type '" + leafClass.getCanonicalName() + "'"); } // Render the identifier return renderIdentifierInner(id, leafClass, context, converter); }
Set<Class<ExternalReferenceSPI>> ensureTypes, ReferenceContext context) throws ReferenceServiceException { checkServices(); if (context == null) { context = new EmptyReferenceContext(); newList.add(resolveIdentifier(item, ensureTypes, context));
references.add(getNameForObject(item, currentDepth - 1, useConverterSPI, context));
boolean useConverterSPI, ReferenceContext context) throws ReferenceServiceException { checkServices(); if (context == null) { context = new EmptyReferenceContext(); checkConverterRegistry(); return getNameForObject(o, targetDepth, useConverterSPI, context);
public Object renderIdentifier(T2Reference id, Class<?> leafClass, ReferenceContext context) throws ReferenceServiceException { checkServices(); return renderIdentifierInner(id, leafClass, context, converter);
private Object renderIdentifierInner(T2Reference id, Class<?> leafClass, ReferenceContext context, StreamToValueConverterSPI<?> converter) throws ReferenceServiceException { checkServices(); List<Object> result = new ArrayList<Object>(); for (T2Reference child : idList) { result.add(renderIdentifierInner(child, leafClass, context, converter));
private Object renderIdentifierInner(T2Reference id, Class<?> leafClass, ReferenceContext context, StreamToValueConverterSPI<?> converter) throws ReferenceServiceException { checkServices(); List<Object> result = new ArrayList<Object>(); for (T2Reference child : idList) { result.add(renderIdentifierInner(child, leafClass, context, converter));
private Object renderIdentifierInner(T2Reference id, Class<?> leafClass, ReferenceContext context, StreamToValueConverterSPI<?> converter) throws ReferenceServiceException { checkServices(); result.add(renderIdentifierInner(child, leafClass, context, converter));