templates.Context.xpt Maven / Gradle / Ivy
?IMPORT dom?
?IMPORT core?
?EXTENSION extensions::EntityExtension?
?EXTENSION extensions::Names?
?EXTENSION extensions::File?
?EXTENSION org::openxma::dsl::common::extensions::LogUtil?
?DEFINE main FOR Model?
?EXPAND genInterface FOREACH eAllContents.typeSelect(ApplicationSession)?
?EXPAND manInterface FOREACH eAllContents.typeSelect(ApplicationSession)?
?EXPAND genClass FOREACH eAllContents.typeSelect(ApplicationSession)?
?EXPAND manClass FOREACH eAllContents.typeSelect(ApplicationSession)?
?ENDDEFINE?
?DEFINE genInterface FOR ApplicationSession?
?info("Write "+getGenInterfaceFileName())?
?FILE getGenInterfaceFileName()-?
package ?getPackageName(false)?;
?addImports()-?
?EXPAND Documentation::documentation FOR this-?
public interface ?getGenInterfaceName()? {
?FOREACH properties AS property-?
?EXPAND Documentation::documentationIndented FOR property-?
?property.type.getFullyQualifiedName(false)? ?property.getAccessorMethodName()?();
?ENDFOREACH-?
?FOREACH functions AS function-?
?function.resultType.getFullyQualifiedName(false)? ?function.name?(?function.parameterType.getFullyQualifiedName(false)? ?function.parameterName?);
?ENDFOREACH-?
?FOREACH conditionsBlock.statusFlags AS flag-?
Boolean ?flag.name.toFirstUpper()?();
?ENDFOREACH-?
}
?ENDFILE?
?ENDDEFINE?
?DEFINE manInterface FOR ApplicationSession?
?info("Write "+getInterfaceFileName())?
?FILE getInterfaceFileName() OUTLET_JAVA-?
package ?getPackageName(false)?;
?EXPAND Documentation::documentation FOR this-?
public interface ?name? extends ?getGenInterfaceName()? {
}
?ENDFILE?
?ENDDEFINE?
?DEFINE genClass FOR ApplicationSession?
?info("Write "+getGenClassFileName())?
?FILE getGenClassFileName()-?
package ?getPackageName(true)?;
?addImports()-?
?EXPAND Documentation::documentation FOR this-?
public abstract class ?getGenClassName()? implements ?getQualifiedInterfaceName()? {
?FOREACH conditionsBlock.statusFlags AS flag-?
public Boolean ?flag.name.toFirstUpper()?() {
return ?EXPAND Expression::expression FOR flag.expression?;
}
?ENDFOREACH-?
public ?getQualifiedInterfaceName()? getContext() {
return this;
}
}
?ENDFILE?
?ENDDEFINE?
?DEFINE manClass FOR ApplicationSession?
?info("Write "+getClassFileName())?
?FILE getClassFileName() OUTLET_JAVA-?
package ?getPackageName(true)?;
?EXPAND Documentation::documentation FOR this-?
public class ?getClassName()? extends ?getGenClassName()? {
?FOREACH properties AS property-?
?EXPAND Documentation::documentationIndented FOR this-?
public ?property.type.getFullyQualifiedName(false)? get?property.name.toFirstUpper()?() {
throw new IllegalStateException("not yet implemented");
}
?ENDFOREACH-?
?FOREACH functions AS function-?
public ?function.resultType.getFullyQualifiedName(false)? ?function.name?(?function.parameterType.getFullyQualifiedName(false)? ?function.parameterName?) {
throw new IllegalStateException("not yet implemented");
}
?ENDFOREACH-?
}
?ENDFILE?
?ENDDEFINE?