/** * {@inheritDoc} */ public synchronized T2Reference nextReferenceSetReference() { T2ReferenceImpl r = new T2ReferenceImpl(); r.setNamespacePart(getNamespace()); r.setLocalPart(getNextLocalPart()); r.setReferenceType(T2ReferenceType.ReferenceSet); r.setDepth(0); r.setContainsErrors(false); return r; }
public T2Reference getChild(T2Reference errorId) throws ErrorDocumentServiceException { T2ReferenceImpl refImpl = T2ReferenceImpl.getAsImpl(errorId); try { return refImpl.getDeeperErrorReference(); } catch (Throwable t) { throw new ErrorDocumentServiceException(t); } }
public final String getInternalId() { if (this.compactId == null) { this.compactId = id.getCompactForm(); } return this.compactId; }
public synchronized String getCompactForm() { if (this.compactForm == null) { this.compactForm = getNamespacePart() + ":" + getLocalPart() + ":" + getDepth(); } return this.compactForm; }
/** * Drill inside an error document reference to get the error one deeper than * this as long as it is at least depth 1. */ T2ReferenceImpl getDeeperErrorReference() { if (getReferenceType().equals(T2ReferenceType.ErrorDocument)) { if (getDepth() == 0) { throw new AssertionError("Error identifier already has depth 0, cannot decrease"); } T2ReferenceImpl result = new T2ReferenceImpl(); result.setContainsErrors(true); result.setDepth(getDepth() - 1); result.setLocalPart(getLocalPart()); result.setNamespacePart(getNamespacePart()); result.setReferenceType(T2ReferenceType.ErrorDocument); return result; } throw new AssertionError( "Attempt to get a deeper reference on something that isn't an error ref"); }
ReferenceSetDao o = (ReferenceSetDao) context .getBean("testDao"); T2ReferenceImpl id = new T2ReferenceImpl(); id.setNamespacePart("testNamespace"); id.setLocalPart("testLocal"); ReferenceSetImpl rs = new ReferenceSetImpl( new HashSet<ExternalReferenceSPI>(), id);
public static T2ReferenceImpl getAsImpl(T2Reference source) { if (source instanceof T2ReferenceImpl) { return (T2ReferenceImpl) source; } else { return new T2ReferenceImpl(source); } }
references), T2ReferenceImpl.getAsImpl(id));
for (ContextualizedT2Reference ci : workingSet) { T2ReferenceImpl ref = (T2ReferenceImpl) ci.getReference(); switch (ref.getReferenceType()) { case IdentifiedList: try { case ErrorDocument: newSet.add(new ContextualizedT2ReferenceImpl(ref .getDeeperErrorReference(), addIndex(ci.getIndex(), 0))); break;
/** * Drill inside an error document reference to get the error one deeper than * this as long as it is at least depth 1. */ T2ReferenceImpl getDeeperErrorReference() { if (getReferenceType().equals(T2ReferenceType.ErrorDocument)) { if (getDepth() == 0) { throw new AssertionError( "Error identifier already has depth 0, cannot decrease"); } T2ReferenceImpl result = new T2ReferenceImpl(); result.setContainsErrors(true); result.setDepth(getDepth() - 1); result.setLocalPart(getLocalPart()); result.setNamespacePart(getNamespacePart()); result.setReferenceType(T2ReferenceType.ErrorDocument); return result; } throw new AssertionError( "Attempt to get a deeper reference on something that isn't an error ref"); }
ReferenceSetDao o = (ReferenceSetDao) context .getBean("testDao"); T2ReferenceImpl id = new T2ReferenceImpl(); id.setNamespacePart("testNamespace"); id.setLocalPart("testLocal"); ReferenceSetImpl rs = new ReferenceSetImpl( new HashSet<ExternalReferenceSPI>(), id);
public synchronized String getCompactForm() { if (this.compactForm == null) { this.compactForm = getNamespacePart() + ":" + getLocalPart() + ":" + getDepth(); } return this.compactForm; }
public static T2ReferenceImpl getAsImpl(T2Reference source) { if (source instanceof T2ReferenceImpl) { return (T2ReferenceImpl) source; } else { return new T2ReferenceImpl(source); } }
public IdentifiedList<T2Reference> registerEmptyList(int depth) throws ListServiceException { checkDao(); checkGenerator(); T2ReferenceImpl newReference = T2ReferenceImpl .getAsImpl(t2ReferenceGenerator.nextListReference(false, depth)); T2ReferenceListImpl newList = new T2ReferenceListImpl(); newList.setTypedId(newReference); try { listDao.store(newList); return newList; } catch (DaoException de) { throw new ListServiceException(de); } }
for (ContextualizedT2Reference ci : workingSet) { T2ReferenceImpl ref = (T2ReferenceImpl) ci.getReference(); switch (ref.getReferenceType()) { case IdentifiedList: try { case ErrorDocument: newSet.add(new ContextualizedT2ReferenceImpl(ref .getDeeperErrorReference(), addIndex(ci.getIndex(), 0))); break;
/** * {@inheritDoc} */ public T2Reference nextErrorDocumentReference(int depth) { T2ReferenceImpl r = new T2ReferenceImpl(); r.setNamespacePart(getNamespace()); r.setLocalPart(getNextLocalPart()); r.setReferenceType(T2ReferenceType.ErrorDocument); r.setDepth(depth); // This is an error document, it contains errors by definition r.setContainsErrors(true); return r; }
/** * Drill inside an error document reference to get the error one deeper than * this as long as it is at least depth 1. */ T2ReferenceImpl getDeeperErrorReference() { if (getReferenceType().equals(T2ReferenceType.ErrorDocument)) { if (getDepth() == 0) { throw new AssertionError( "Error identifier already has depth 0, cannot decrease"); } T2ReferenceImpl result = new T2ReferenceImpl(); result.setContainsErrors(true); result.setDepth(getDepth() - 1); result.setLocalPart(getLocalPart()); result.setNamespacePart(getNamespacePart()); result.setReferenceType(T2ReferenceType.ErrorDocument); return result; } throw new AssertionError( "Attempt to get a deeper reference on something that isn't an error ref"); }
public T2Reference getChild(T2Reference errorId) throws ErrorDocumentServiceException { T2ReferenceImpl refImpl = T2ReferenceImpl.getAsImpl(errorId); try { return refImpl.getDeeperErrorReference(); } catch (Throwable t) { throw new ErrorDocumentServiceException(t); } }
public synchronized String getCompactForm() { return getNamespacePart() + ":" + getLocalPart() + ":" + getDepth(); }
public final String getInternalId() { if (this.compactId == null) { this.compactId = id.getCompactForm(); } return this.compactId; }