org.overlord.sramp.common
Class ArtifactType

java.lang.Object
  extended by org.overlord.sramp.common.ArtifactType

public class ArtifactType
extends Object

A class representing all of the Artifact Types defined by S-RAMP.

Author:
eric.wittmann@redhat.com

Method Summary
static ArtifactType Document()
           
static ArtifactType Extended(String extendedType, boolean derived)
           
static ArtifactType fromFileExtension(String extension)
          Returns an ArtifactType given a common file extension.
 ArtifactTypeEnum getArtifactType()
           
 String getExtendedType()
           
 String getLabel()
           
 String getMimeType()
           
 String getModel()
           
 String getType()
           
 boolean isDerived()
           
protected  boolean isExtendedDerivedType()
           
 boolean isExtendedType()
           
 BaseArtifactType newArtifactInstance()
          Instantiates an S-RAMP artifact of the correct type, and populates the artifactType and the contentType.
static ArtifactType PolicyDocument()
           
 void setArtifactType(ArtifactTypeEnum artifactType)
           
 void setExtendedDerivedType(boolean extendedDerivedType)
           
 void setExtendedType(String extendedType)
           
 void setMimeType(String mimeType)
           
 String toString()
           
 BaseArtifactType unwrap(Artifact artifactWrapper)
          Called to unwrap the S-RAMP artifact from its wrapper.
static ArtifactType valueOf(Artifact artifactWrapper)
          What kind of artifact is inside that wrapper?
static ArtifactType valueOf(BaseArtifactEnum apiType)
          Figures out the type from the s-ramp API type.
static ArtifactType valueOf(BaseArtifactType artifact)
          Figures out the type from the artifact instance.
static ArtifactType valueOf(String artifactType)
          Figures out the artifact type (enum) from the given S-RAMP artifact type string.
static ArtifactType valueOf(String model, String type)
          Figures out the artifact type (enum) from the given S-RAMP artifact type string.
static ArtifactType WsdlDocument()
           
static ArtifactType XmlDocument()
           
static ArtifactType XsdDocument()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

Document

public static final ArtifactType Document()

XmlDocument

public static final ArtifactType XmlDocument()

XsdDocument

public static final ArtifactType XsdDocument()

WsdlDocument

public static final ArtifactType WsdlDocument()

PolicyDocument

public static final ArtifactType PolicyDocument()

Extended

public static final ArtifactType Extended(String extendedType,
                                          boolean derived)

unwrap

public BaseArtifactType unwrap(Artifact artifactWrapper)
Called to unwrap the S-RAMP artifact from its wrapper.

Parameters:
artifactWrapper - the S-RAMP artifact wrapper
Returns:
the specific artifact based on type

fromFileExtension

public static ArtifactType fromFileExtension(String extension)
Returns an ArtifactType given a common file extension.

Parameters:
extension - a file extension
Returns:
an s-ramp artifact type

valueOf

public static ArtifactType valueOf(String artifactType)
Figures out the artifact type (enum) from the given S-RAMP artifact type string.

Parameters:
artifactType -

valueOf

public static ArtifactType valueOf(String model,
                                   String type)
Figures out the artifact type (enum) from the given S-RAMP artifact type string.

Parameters:
artifactType -

valueOf

public static ArtifactType valueOf(BaseArtifactType artifact)
Figures out the type from the artifact instance.

Parameters:
artifact -

newArtifactInstance

public BaseArtifactType newArtifactInstance()
Instantiates an S-RAMP artifact of the correct type, and populates the artifactType and the contentType.

Parameters:
artifactType -

valueOf

public static ArtifactType valueOf(BaseArtifactEnum apiType)
Figures out the type from the s-ramp API type.

Parameters:
apiType -

getArtifactType

public ArtifactTypeEnum getArtifactType()
Returns:
the artifactType

isExtendedType

public boolean isExtendedType()
Returns:
true if the type is a ExtendedArtifactType.

isDerived

public boolean isDerived()
Returns:
true if the artifact is derived

setArtifactType

public void setArtifactType(ArtifactTypeEnum artifactType)
Parameters:
artifactType - the artifactType to set

getModel

public String getModel()
Returns:
the artifact model

getType

public String getType()
Returns:
the artifact type

getLabel

public String getLabel()
Returns:
the artifact type label

getMimeType

public String getMimeType()
Returns:
the mimeType

setMimeType

public void setMimeType(String mimeType)
Parameters:
mimeType - the mimeType to set

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

setExtendedType

public void setExtendedType(String extendedType)

getExtendedType

public String getExtendedType()

valueOf

public static ArtifactType valueOf(Artifact artifactWrapper)
What kind of artifact is inside that wrapper?

Parameters:
artifactWrapper -

isExtendedDerivedType

protected boolean isExtendedDerivedType()
Returns:
the extendedDerivedType

setExtendedDerivedType

public void setExtendedDerivedType(boolean extendedDerivedType)
Parameters:
extendedDerivedType - the extendedDerivedType to set


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.