Business Component
General Archetype
component.rnc
start = component
component = element component{
component.title,
component.domain,
component.name,
component.type,
component.namespace,
component.implementor,
component.description
}
component.title = element title { xsd:string {maxLength = "256"}}
component.domain = element domain { xsd:string {maxLength = "256" }}
component.name = element name { xsd:string {maxLength = "256" pattern = "[A-Za-z][0-9A-Za-z]*"}}
component.type = element type { string "default"
| string "service"
| string "domain"
| string "composite"
| string "operation" }
component.namespace = element namespace { xsd:string }
component.implementor = element implementor { xsd:string }
component.description = element description { xsd:string }
component-env.rnc
start = compopnent-env
component-env = element component-env{
element locale { xsd:string },
element platform { string "EJB 2.1" |
string "EJB 3.0" |
string "OSGi" }
}
Java Archetype
component.java.rnc
# @todo Is there any way to override the existing definition or grammar.
include "component.rnc" {
component.name = element name { xsd:string {maxLength = "256" pattern = "[A-Z][0-9A-Za-z]*"}}
component.namespace = element namespace { xsd:string {pattern = "([a-z][0-9a-z]*\.)*([a-z][0-9a-z]*)"}}
# @todo Need more accurate pattern to prohibit namespace starting with 'java' or 'javax'
component.implementor = element implementor { xsd:string }
# @todo Is there anyway to express the constraint saying that implementor = namespace + '.' + name
}
Business Message
General Archetype
message-context.rnc
start = message-context
message-context = element message-context{
element service-id { xsd:string }
}
message-data.rnc
start = message-data
message-data = element message-data{
element input-data { text },
element output-data { text }
}
element message-data-item{
element title { xsd:string {maxLength = "256"}},
element name { xsd:string {maxLength = "256" pattern = "[A-Z][0-9_A-Z]*"}},
element datatype { string "string" |
string "int16" | # 2-byte integer
string "int32" | # 4-byte integer
string "int64" | # 8-byte integer
string "decimal32" | # 4-byte floating point type
string "decimal64" | # 8-byte floating point type
string "decimal" | # decimal number without restriction on precision and scale
string "binary"},
element data-length { xsd:string { pattern = "[1-9][0-9]*(\.[1-9][0-9]*)?" }},
element encoding { string "text" | string "binary" },
element item-length { xsd:int }
}
data-type = element data-type{
(element name { string "string" |
string "int16" | # 2-byte integer
string "int32" | # 4-byte integer
string "int64" | # 8-byte integer
string "binary"},
element length { xsd:positiveInteger })
|
(element name { string "decimal32" | # 4-byte floating point type
string "decimal64" | # 8-byte floating point type
string "decimal"}, # decimal number without restriction on precision and scale
element precision { xsd:positiveInteger },
element scale { xsd:int })
|
(element name { string "binary" },
element size { xsd:positiveInteger })
}
message-env.rnc
start = message-env
message-env = element message-env{
text-encoding,
endianness
}
text-encoding = element text-encoding { text }
endianness = element endianness { string "big-endian" | string "little-endian" }
No comments:
Post a Comment