de.grogra.xl.property
Interface CompiletimeModel.Property

All Known Implementing Classes:
CompiletimeModel.PropertyImpl, PropertyCompiletime.GraphProperty
Enclosing interface:
CompiletimeModel

public static interface CompiletimeModel.Property

A compile-time Property is declared by the current CompiletimeModel and represents a property as defined by the specification of the XL programming language. Properties are similar to fields, but can be used in deferred assignments and some other constructs of the XL programming language.

A Property represents a property at compile-time. This has to be accompanied by a corresponding instance of RuntimeModel.Property that is used at run-time. The correct run-time property instance is obtained by invocations of RuntimeModel.propertyForName(String, ClassLoader) with the name returned by getRuntimeName() as parameter.

A comprehensive specification of the behaviour of Property is given by the specification of the XL programming language.

Author:
Ole Kniemeyer

Method Summary
 CompiletimeModel.Property getComponentProperty()
          Returns the component property.
 CompiletimeModel getModel()
          Returns this property's compile-time model.
 java.lang.String getRuntimeName()
          Defines the name of the corresponding RuntimeModel.Property.
 Type<? extends RuntimeModel.Property> getRuntimeType()
           
 CompiletimeModel.Property getSubProperty(java.lang.String name)
          Returns a subproperty.
 Type<?> getType()
          Returns this property's type.
 CompiletimeModel.Property getTypeCastProperty(Type<?> type)
          Returns a type-cast property.
 

Method Detail

getComponentProperty

CompiletimeModel.Property getComponentProperty()
Returns the component property. If this property has an array type, then a component property may exist and is returned by this method, otherwise null is returned.

Returns:
the component property, if any

getModel

CompiletimeModel getModel()
Returns this property's compile-time model. This is the model which has declared this property.

Returns:
this property's model

getRuntimeName

java.lang.String getRuntimeName()
Defines the name of the corresponding RuntimeModel.Property. This name is used during run-time in invocations of RuntimeModel.propertyForName(String, ClassLoader) in order to obtain the RuntimeModel.Property which corresponds to this compile-time property.

Returns:
the name of the corresponding run-time property

getRuntimeType

Type<? extends RuntimeModel.Property> getRuntimeType()

getSubProperty

CompiletimeModel.Property getSubProperty(java.lang.String name)
Returns a subproperty. If this property has a subproperty named name, then this subproperty is returned, otherwise null.

Parameters:
name - the name of the subproperty
Returns:
the subproperty, if any

getType

Type<?> getType()
Returns this property's type.

Returns:
this property's type

getTypeCastProperty

CompiletimeModel.Property getTypeCastProperty(Type<?> type)
Returns a type-cast property. type has to be a reference type which is assignable to the type of this property. The method returns the corresponding type-cast property.

Parameters:
type - the type of the type-cast property
Returns:
the type-cast property