public static BaseArtifactEnum fromValue(String v) { for (BaseArtifactEnum c: BaseArtifactEnum.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
/** * Figures out the type from the s-ramp API type. * @param apiType */ public static ArtifactTypeEnum valueOf(BaseArtifactEnum apiType) { ArtifactTypeEnum[] values = values(); for (ArtifactTypeEnum artifactType : values) { if (artifactType.getApiType() == apiType) { return artifactType; } } throw new RuntimeException(Messages.i18n.format("ARTIFACT_TYPE_FROM_APITYPE_ERROR", apiType.value())); //$NON-NLS-1$ }
@Override public void visit(ServiceInstance artifact) { super.visit(artifact); try { List<String> targetTypes = new ArrayList<String>(); for (BaseArtifactTarget target : artifact.getUses()) { targetTypes.add(target.getArtifactType().toString()); } setRelationships("uses", RelationshipType.MODELED, artifact.getUses()); targetTypes = new ArrayList<String>(); for (BaseArtifactTarget target : artifact.getDescribedBy()) { targetTypes.add(target.getArtifactType().toString()); } setRelationships("describedBy", RelationshipType.MODELED, artifact.getDescribedBy()); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Figures out the type from the s-ramp API type. * @param apiType */ public static ArtifactTypeEnum valueOf(BaseArtifactEnum apiType) { ArtifactTypeEnum[] values = values(); for (ArtifactTypeEnum artifactType : values) { if (artifactType.getApiType() == apiType) { return artifactType; } } throw new RuntimeException(Messages.i18n.format("ARTIFACT_TYPE_FROM_APITYPE_ERROR", apiType.value())); }
NamedWsdlDerivedArtifactType arty = (NamedWsdlDerivedArtifactType) artifact; if (arty.getNCName() != null) index.put(new QName(arty.getArtifactType().toString(), arty.getNCName()), artifact); } else if (artifact instanceof WsdlExtension) { WsdlExtension arty = (WsdlExtension) artifact; index.put(new QName(arty.getArtifactType().toString(), arty.getNCName()), arty); } else if (artifact instanceof ElementDeclaration) { ElementDeclaration arty = (ElementDeclaration) artifact; index.put(new QName(arty.getArtifactType().toString(), arty.getNCName()), artifact); } else if (artifact instanceof AttributeDeclaration) { AttributeDeclaration arty = (AttributeDeclaration) artifact; index.put(new QName(arty.getArtifactType().toString(), arty.getNCName()), artifact); } else if (artifact instanceof SimpleTypeDeclaration) { SimpleTypeDeclaration arty = (SimpleTypeDeclaration) artifact; index.put(new QName(arty.getArtifactType().toString(), arty.getNCName()), artifact); } else if (artifact instanceof ComplexTypeDeclaration) { ComplexTypeDeclaration arty = (ComplexTypeDeclaration) artifact; index.put(new QName(arty.getArtifactType().toString(), arty.getNCName()), artifact); DerivedArtifactType artifact = index.get(new QName(BaseArtifactEnum.MESSAGE.toString(), "findRequest")); //$NON-NLS-1$ Assert.assertNotNull(artifact); Assert.assertEquals("findRequest", artifact.getName()); //$NON-NLS-1$ artifact = index.get(new QName(BaseArtifactEnum.ELEMENT_DECLARATION.toString(), "findResponse")); //$NON-NLS-1$ Assert.assertNotNull(artifact); Assert.assertEquals("findResponse", artifact.getName()); //$NON-NLS-1$ artifact = index.get(new QName(BaseArtifactEnum.SIMPLE_TYPE_DECLARATION.toString(), "keywordType")); //$NON-NLS-1$ Assert.assertNotNull(artifact);
/** * Figures out the type from the s-ramp API type. * @param apiType */ public static ArtifactType valueOf(BaseArtifactEnum apiType) { ArtifactTypeEnum[] values = ArtifactTypeEnum.values(); for (ArtifactTypeEnum artifactType : values) { if (artifactType.getApiType() == apiType) { return new ArtifactType(artifactType, null); } } throw new RuntimeException(Messages.i18n.format("ARTIFACT_TYPE_FROM_APITYPE_ERROR", apiType.value())); }
public static BaseArtifactEnum fromValue(String v) { for (BaseArtifactEnum c: BaseArtifactEnum.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
/** * Figures out the type from the s-ramp API type. * @param apiType */ public static ArtifactType valueOf(BaseArtifactEnum apiType) { ArtifactTypeEnum[] values = ArtifactTypeEnum.values(); for (ArtifactTypeEnum artifactType : values) { if (artifactType.getApiType() == apiType) { return new ArtifactType(artifactType, null); } } throw new RuntimeException(Messages.i18n.format("ARTIFACT_TYPE_FROM_APITYPE_ERROR", apiType.value())); //$NON-NLS-1$ }
String jcrMixinName = artifactType.getArtifactType().getApiType().value(); jcrMixinName = JCRConstants.SRAMP_ + StringUtils.uncapitalize(jcrMixinName); artifactNode.addMixin(jcrMixinName);
String jcrMixinName = derivedArtifactType.getArtifactType().getApiType().value(); if (derivedArtifactType.isExtendedType()) { jcrMixinName = "extendedDerivedArtifactType"; //$NON-NLS-1$