@Test public void testDeclareTagDefinitions() throws Exception { Xsd2UmlPluginHost host = Mockito.mock(Xsd2UmlPluginHost.class); Mockito.when(host.ensureTagDefinitionId(Matchers.anyString())).thenReturn(Identifier.random()); List<TagDefinition> tagDefinitionList = pluginForSLI.declareTagDefinitions(host); Assert.assertNotNull(tagDefinitionList); Assert.assertEquals(18, tagDefinitionList.size()); }
@Override public List<TagDefinition> declareTagDefinitions(final Xsd2UmlPluginHost host) { final List<TagDefinition> tagDefs = new LinkedList<TagDefinition>(); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_COLLECTION_NAME, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_NATURAL_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SELF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_APPLY_NATURAL_KEYS, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_PII, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_READ, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_WRITE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RELAXED_BLACKLIST, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REST_RESOURCE, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RESTRICTED_FOR_LOGGING, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SECURITY_SPHERE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATION_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_BEGIN_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_END_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATED_DATED_COLLECTION, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_BEGIN_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_END_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); return Collections.unmodifiableList(tagDefs); }
Xsd2UmlPluginForSLI extends Xsd2UmlPluginDefault { @Override public List<TagDefinition> declareTagDefinitions(final Xsd2UmlPluginHost host) { final List<TagDefinition> tagDefs = new LinkedList<TagDefinition>(); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_COLLECTION_NAME, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_NATURAL_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SELF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_APPLY_NATURAL_KEYS, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_PII, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_READ, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_WRITE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RELAXED_BLACKLIST, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REST_RESOURCE, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RESTRICTED_FOR_LOGGING, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SECURITY_SPHERE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATION_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_BEGIN_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_END_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATED_DATED_COLLECTION, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_BEGIN_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_END_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); return Collections.unmodifiableList(tagDefs); } }
Xsd2UmlPluginForSLI extends Xsd2UmlPluginDefault { @Override public List<TagDefinition> declareTagDefinitions(final Xsd2UmlPluginHost host) { final List<TagDefinition> tagDefs = new LinkedList<TagDefinition>(); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_COLLECTION_NAME, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_NATURAL_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SELF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_APPLY_NATURAL_KEYS, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_PII, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_READ, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_WRITE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RELAXED_BLACKLIST, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REST_RESOURCE, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RESTRICTED_FOR_LOGGING, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SECURITY_SPHERE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATION_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_BEGIN_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_END_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATED_DATED_COLLECTION, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_BEGIN_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_END_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); return Collections.unmodifiableList(tagDefs); } Xsd2UmlPluginForSLI(); }
Xsd2UmlPluginForSLI extends Xsd2UmlPluginDefault { @Override public List<TagDefinition> declareTagDefinitions(final Xsd2UmlPluginHost host) { final List<TagDefinition> tagDefs = new LinkedList<TagDefinition>(); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_COLLECTION_NAME, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_NATURAL_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SELF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_APPLY_NATURAL_KEYS, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_PII, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_READ, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_WRITE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RELAXED_BLACKLIST, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REST_RESOURCE, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RESTRICTED_FOR_LOGGING, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SECURITY_SPHERE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATION_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_BEGIN_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_END_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATED_DATED_COLLECTION, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_BEGIN_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_END_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); return Collections.unmodifiableList(tagDefs); } Xsd2UmlPluginForSLI(); @Override List<TagDefinition> declareTagDefinitions(final Xsd2UmlPluginHost host); @Override String getAssociationEndTypeName(final ClassType classType, final Attribute attribute,
            final Xsd2UmlPluginHost host); @Override /** * The most reliable way to determine whether the attribute should be an association is to look for the tag that indicates * that the attribute should be treated as a reference. If there is no tag then we look for clues in the name of the attribute. */ boolean isAssociationEnd(final ClassType classType, final Attribute attribute, final Xsd2UmlPluginHost host); @Override String nameAssociation(final AssociationEnd lhs, final AssociationEnd rhs, final Xsd2UmlHostedPlugin host); @Override String nameFromSchemaTypeName(final QName name); @Override List<TaggedValue> tagsFromAppInfo(final XmlSchemaAppInfo appInfo, final Xsd2UmlPluginHost host); }
Xsd2UmlPluginForSLI extends Xsd2UmlPluginDefault { @Override public List<TagDefinition> declareTagDefinitions(final Xsd2UmlPluginHost host) { final List<TagDefinition> tagDefs = new LinkedList<TagDefinition>(); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_COLLECTION_NAME, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_NATURAL_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SELF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_APPLY_NATURAL_KEYS, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_PII, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_READ, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ENFORCE_WRITE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REFERENCE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RELAXED_BLACKLIST, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_REST_RESOURCE, Occurs.ZERO, Occurs.UNBOUNDED, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_RESTRICTED_FOR_LOGGING, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_SECURITY_SPHERE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATION_KEY, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_BEGIN_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_END_DATE, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_ASSOCIATED_DATED_COLLECTION, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_BEGIN_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); tagDefs.add(makeTagDefinition(SliUmlConstants.TAGDEF_FILTER_END_DATE_ON, Occurs.ZERO, Occurs.ONE, host)); return Collections.unmodifiableList(tagDefs); } Xsd2UmlPluginForSLI(); @Override List<TagDefinition> declareTagDefinitions(final Xsd2UmlPluginHost host); @Override String getAssociationEndTypeName(final ClassType classType, final Attribute attribute,
            final Xsd2UmlPluginHost host); @Override /** * The most reliable way to determine whether the attribute should be an association is to look for the tag that indicates * that the attribute should be treated as a reference. If there is no tag then we look for clues in the name of the attribute. */ boolean isAssociationEnd(final ClassType classType, final Attribute attribute, final Xsd2UmlPluginHost host); @Override String nameAssociation(final AssociationEnd lhs, final AssociationEnd rhs, final Xsd2UmlHostedPlugin host); @Override String nameFromSchemaTypeName(final QName name); @Override List<TaggedValue> tagsFromAppInfo(final XmlSchemaAppInfo appInfo, final Xsd2UmlPluginHost host);  }