org.inria.ns.reflex.processor.asl
Class BuiltinSchema

java.lang.Object
  extended by org.inria.ns.reflex.processor.asl.BuiltinSchema
All Implemented Interfaces:
Schema, Localizable
Direct Known Subclasses:
BuiltinTypeSchema

public class BuiltinSchema
extends Object
implements Schema

A support for built-in schemata. Just fill-in the definitions.

Author:
Philippe Poulard

Constructor Summary
BuiltinSchema(String targetNamespaceURI)
          Creates a new instance of BuiltinSchema.
 
Method Summary
 void addAttributeDefinition(AttributeDefinition attributeDefinition)
          Adds an attribute definition.
 void addElementDefinition(ElementDefinition elementDefinition)
          Adds an element definition.
 void addIdAction(Identifiable identifiable)
          Adds an identifiable.
 void addTypeDefinition(Type type)
          Adds a type definition.
 AttributeDefinition getAttributeDefinition(Attr attribute)
          Return an attribute definition defined in this schema.
 AttributeDefinition getAttributeDefinition(QName name)
          Return an attribute definition defined in this schema.
 ElementDefinition getElementDefinition(Element element)
          Return an element definition defined in this schema.
 ElementDefinition getElementDefinition(QName name)
          Return an element definition defined in this schema.
 ElementDefinition getElementDefinition(String namespaceURI)
          Return the fallback element definition defined in this schema.
 Identifiable getIdentifiable(QName id)
          Return an action that has an ID.
 XFile getLocation()
          This default implementation is not localizable.
 String getTargetNamespaceURI()
          Return the target namespace URI of the schema.
 Type getTypeDefinition(QName name)
          Return a type definition defined in this schema.
 Type getTypeDefinition(String namespaceURI)
          Return the fallback type definition.
 boolean isLocalizable()
          Indicates that this instance is not localizable.
 void setLocation(XFile location)
          This default implementation is not localizable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuiltinSchema

public BuiltinSchema(String targetNamespaceURI)
Creates a new instance of BuiltinSchema.

Parameters:
targetNamespaceURI - The target namespace URI of this schema.
Method Detail

getTargetNamespaceURI

public String getTargetNamespaceURI()
Return the target namespace URI of the schema.

Specified by:
getTargetNamespaceURI in interface Schema
Returns:
The target namespace URI.

addIdAction

public void addIdAction(Identifiable identifiable)
Adds an identifiable.

Parameters:
identifiable - The object that has an ID.

getIdentifiable

public Identifiable getIdentifiable(QName id)
Return an action that has an ID.

Specified by:
getIdentifiable in interface Schema
Parameters:
action - The action that has an ID.
Returns:
The action that has the ID expected.

addElementDefinition

public void addElementDefinition(ElementDefinition elementDefinition)
Adds an element definition.

Parameters:
elementDefinition - The element definition to add.

addAttributeDefinition

public void addAttributeDefinition(AttributeDefinition attributeDefinition)
Adds an attribute definition. Anonymous attributes are ignored.

Parameters:
attributeDefinition - The attribute definition to add.

getElementDefinition

public ElementDefinition getElementDefinition(QName name)
Return an element definition defined in this schema.

Specified by:
getElementDefinition in interface Schema
Parameters:
name - The name of the element.
Returns:
The element definition expected if any, or the fallback definition if any, null otherwise.
See Also:
Schema.getElementDefinition(QName)

getElementDefinition

public ElementDefinition getElementDefinition(Element element)
Return an element definition defined in this schema.

Specified by:
getElementDefinition in interface Schema
Parameters:
name - The name of the element.
Returns:
The element definition expected if any, or the fallback definition if any, null otherwise.
See Also:
Schema.getElementDefinition(Element)

getElementDefinition

public ElementDefinition getElementDefinition(String namespaceURI)
Return the fallback element definition defined in this schema.

Specified by:
getElementDefinition in interface Schema
Parameters:
name - The name of the element.
Returns:
The element definition expected if any, or the fallback definition if any, null otherwise.
See Also:
Schema.getElementDefinition(java.lang.String)

addTypeDefinition

public void addTypeDefinition(Type type)
Adds a type definition. Anonymous types are ignored.

Parameters:
type - The type definition to add.

getTypeDefinition

public Type getTypeDefinition(QName name)
Return a type definition defined in this schema.

Specified by:
getTypeDefinition in interface Schema
Parameters:
name - The name of the type.
Returns:
The type definition expected if any.
See Also:
Schema.getTypeDefinition(QName)

getTypeDefinition

public Type getTypeDefinition(String namespaceURI)
Return the fallback type definition.

Specified by:
getTypeDefinition in interface Schema
Parameters:
name - The name of the type.
Returns:
The type definition expected if any.
See Also:
Schema.getTypeDefinition(java.lang.String)

getAttributeDefinition

public AttributeDefinition getAttributeDefinition(QName name)
Return an attribute definition defined in this schema.

Specified by:
getAttributeDefinition in interface Schema
Parameters:
name - The name of the attribute.
Returns:
The attribute definition expected if any, null otherwise.
See Also:
Schema.getAttributeDefinition(QName)

getAttributeDefinition

public AttributeDefinition getAttributeDefinition(Attr attribute)
Return an attribute definition defined in this schema.

Specified by:
getAttributeDefinition in interface Schema
Parameters:
name - The name of the attribute.
Returns:
The attribute definition expected if any, null otherwise.
See Also:
Schema.getAttributeDefinition(org.w3c.dom.Attr)

getLocation

public XFile getLocation()
                  throws UnlocalizableException
This default implementation is not localizable. Subclasses that are localizable should override this method.

Specified by:
getLocation in interface Localizable
Returns:
The URI of this component, as an XFile, or null.
Throws:
UnlocalizableException - Always thrown.
See Also:
Localizable.getLocation()

isLocalizable

public boolean isLocalizable()
Indicates that this instance is not localizable.

Specified by:
isLocalizable in interface Localizable
Returns:
false.
See Also:
Localizable.isLocalizable()

setLocation

public void setLocation(XFile location)
                 throws UnlocalizableException
This default implementation is not localizable. Subclasses that are localizable should override this method.

Specified by:
setLocation in interface Localizable
Parameters:
location - Not used.
Throws:
UnlocalizableException - Always thrown.
See Also:
Localizable.setLocation(org.inria.ns.reflex.modules.io.XFile)