SimpleIdentifierFactory implements IIdentifierFactory { @Nullable public SimpleDocumentTypeIdentifier createDocumentTypeIdentifier (@Nullable final String sScheme, @Nullable final String sValue) { final String sRealValue = isDocumentTypeIdentifierCaseInsensitive (sScheme) ? getUnifiedValue (sValue) : sValue; return new SimpleDocumentTypeIdentifier (nullNotEmpty (sScheme), nullNotEmpty (sRealValue)); } SimpleIdentifierFactory(); @Override boolean isProcessIdentifierSchemeMandatory(); @Nullable SimpleDocumentTypeIdentifier createDocumentTypeIdentifier(@Nullable final String sScheme, @Nullable final String sValue); @Nullable SimpleParticipantIdentifier createParticipantIdentifier(@Nullable final String sScheme, @Nullable final String sValue); @Nullable SimpleProcessIdentifier createProcessIdentifier(@Nullable final String sScheme, @Nullable final String sValue); @Override String toString(); static final SimpleIdentifierFactory INSTANCE; }
@Test public void testDocTypeIDCreation () { final SimpleIdentifierFactory aIF = SimpleIdentifierFactory.INSTANCE; assertNotNull (aIF.createDocumentTypeIdentifier (null, null)); assertNotNull (aIF.createDocumentTypeIdentifier (null, "any")); assertNotNull (aIF.createDocumentTypeIdentifier (null, "")); assertNotNull (aIF.createDocumentTypeIdentifier ("", "")); assertNotNull (aIF.createDocumentTypeIdentifier ("bla::#: }
@Test public void testDocTypeID () { final SimpleIdentifierFactory aIF = SimpleIdentifierFactory.INSTANCE; String sScheme = CBDXR1Identifier.DEFAULT_DOCUMENT_TYPE_IDENTIFIER_SCHEME; IDocumentTypeIdentifier aID1 = aIF.createDocumentTypeIdentifier (sScheme, "abc"); assertEquals (sScheme, aID1.getScheme ()); assertEquals ("abc", aID1.getValue ()); IDocumentTypeIdentifier aID2 = aIF.createDocumentTypeIdentifier (sScheme, "ABC"); assertEquals (sScheme, aID2.getScheme ()); assertEquals ("ABC", aID2.getValue ()); assertFalse (aID1.hasSameContent (aID2)); sScheme = "cs-doctype-scheme"; aID1 = aIF.createDocumentTypeIdentifier (sScheme, "abc"); assertEquals (sScheme, aID1.getScheme ()); assertEquals ("abc", aID1.getValue ()); aID2 = aIF.createDocumentTypeIdentifier (sScheme, "ABC"); assertEquals (sScheme, aID2.getScheme ()); assertEquals ("ABC", aID2.getValue ()); assertFalse (aID1.hasSameContent (aID2)); }