@Test public void shouldFailConstructionIfNotTranslator() { if ( RelationalObjectImpl.VALIDATE_INITIAL_STATE ) { try { new TranslatorImpl( getTransaction(), _repo, this.translator.getParent( getTransaction() ).getAbsolutePath() ); fail(); } catch ( final KException e ) { } } }
@Override public KomodoObject getParent( final UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); KomodoObject parent = super.getParent(transaction); Descriptor parentType = parent.getPrimaryType(transaction); if (VdbLexicon.Vdb.TRANSLATORS.equals(parentType.getName())) { return parent.getParent(transaction); } return parent; }
TranslatorImpl extends RelationalChildRestrictedObject implements Translator { @Override public KomodoObject getParent( final UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); KomodoObject parent = super.getParent(transaction); Descriptor parentType = parent.getPrimaryType(transaction); if (VdbLexicon.Vdb.TRANSLATORS.equals(parentType.getName())) { return parent.getParent(transaction); } return parent; } }
TranslatorImpl extends RelationalChildRestrictedObject implements Translator { @Override public KomodoObject getParent( final UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); KomodoObject parent = super.getParent(transaction); Descriptor parentType = parent.getPrimaryType(transaction); if (VdbLexicon.Vdb.TRANSLATORS.equals(parentType.getName())) { return parent.getParent(transaction); } return parent; } TranslatorImpl( final UnitOfWork uow,
                           final Repository repository,
                           final String workspacePath ); }
TranslatorImpl extends RelationalChildRestrictedObject implements Translator { @Override public KomodoObject getParent( final UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); KomodoObject parent = super.getParent(transaction); Descriptor parentType = parent.getPrimaryType(transaction); if (VdbLexicon.Vdb.TRANSLATORS.equals(parentType.getName())) { return parent.getParent(transaction); } return parent; } TranslatorImpl( final UnitOfWork uow,
                           final Repository repository,
                           final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override String getDescription( final UnitOfWork uow ); @Override KomodoObject getParent( final UnitOfWork transaction ); @Override String getType( final UnitOfWork uow ); @Override int getTypeId(); @Override void setDescription( final UnitOfWork uow,
                                final String newDescription ); @Override void setType( final UnitOfWork uow,
                         final String newType ); }
TranslatorImpl extends RelationalChildRestrictedObject implements Translator { @Override public KomodoObject getParent( final UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); KomodoObject parent = super.getParent(transaction); Descriptor parentType = parent.getPrimaryType(transaction); if (VdbLexicon.Vdb.TRANSLATORS.equals(parentType.getName())) { return parent.getParent(transaction); } return parent; } TranslatorImpl( final UnitOfWork uow,
                           final Repository repository,
                           final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override String getDescription( final UnitOfWork uow ); @Override KomodoObject getParent( final UnitOfWork transaction ); @Override String getType( final UnitOfWork uow ); @Override int getTypeId(); @Override void setDescription( final UnitOfWork uow,
                                final String newDescription ); @Override void setType( final UnitOfWork uow,
                         final String newType );  }