package MetadataTest {
private import 'User Defined Extensions'::*;
library package 'User Defined Extensions' {
datatype ClassificationLevel :> ScalarValues::Natural;
feature uncl[1] : ClassificationLevel = 0;
feature conf[1] : ClassificationLevel = 1;
feature secret[1] : ClassificationLevel = 2;
metaclass Classified {
feature :>> annotatedElement : KerML::Feature;
feature classificationLevel : ClassificationLevel;
}
metaclass Security;
}
feature x {
metadata Classified {
classificationLevel = conf;
}
}
feature y {
@Classified {
classificationLevel = conf;
}
@Security;
}
private #Classified #Security feature z1;
abstract #Classified z2;
feature z {
#Security #Classified metadata Classified {
classificationLevel = secret;
}
}
class CC;
struct SS {
feature cc : CC;
}
metaclass M :> Metaobjects::SemanticMetadata {
:>> annotatedElement : KerML::Class;
:>> baseType = if annotatedElement istype KerML::Structure ?
SS meta KerML::Type else CC meta KerML::Class;
}
#M struct T {
feature :>> cc;
}
}