public abstract class Element extends ElementConstants implements LocatableMatadata
ATTR_ACCESS, ATTR_ALLOCATION_SIZE, ATTR_CACHABLE, ATTR_CATALOG, ATTR_CLASS, ATTR_COLUMN, ATTR_COLUMN_DEFINITION, ATTR_DISCRIMINATOR_COLUMN, ATTR_DISCRIMINATOR_TYPE, ATTR_ENTITY_CLASS, ATTR_FETCH, ATTR_GENERATOR, ATTR_ID, ATTR_INITIAL_VALUE, ATTR_INSERTABLE, ATTR_LENGTH, ATTR_MAPPED_BY, ATTR_MAPS_ID, ATTR_METADATA_COMPLETE, ATTR_NAME, ATTR_NULLABLE, ATTR_OPTIONAL, ATTR_ORPHAN_REMOVAL, ATTR_PK_COLUMN_NAME, ATTR_PK_COLUMN_VALUE, ATTR_PRECISION, ATTR_REFERENCED_COLUMN_NAME, ATTR_RESULT_CLASS, ATTR_RESULT_SET_MAPPING, ATTR_SCALE, ATTR_SCHEMA, ATTR_SEQUENCE_NAME, ATTR_STRATEGY, ATTR_TABLE, ATTR_TARGET_CLASS, ATTR_TARGET_ENTITY, ATTR_UNIQUE, ATTR_UPDATABLE, ATTR_VALUE, ATTR_VALUE_COLUMN_NAME, ELEMENT_ACCESS, ELEMENT_ASSOCIATION_OVERRIDE, ELEMENT_ATTRIBUTE_OVERRIDE, ELEMENT_ATTRIBUTES, ELEMENT_BASIC, ELEMENT_CASCADE, ELEMENT_CASCADE_ALL, ELEMENT_CASCADE_DETACH, ELEMENT_CASCADE_MERGE, ELEMENT_CASCADE_PERSIST, ELEMENT_CASCADE_REFRESH, ELEMENT_CASCADE_REMOVE, ELEMENT_CATALOG, ELEMENT_COLLECTION_TABLE, ELEMENT_COLUMN, ELEMENT_COLUMN_NAME, ELEMENT_COLUMN_RESULT, ELEMENT_DISCRIMINATOR_COLUMN, ELEMENT_DISCRIMINATOR_VALUE, ELEMENT_ELEMENT_COLLECTION, ELEMENT_EMBEDDABLE, ELEMENT_EMBEDDED, ELEMENT_EMBEDDED_ID, ELEMENT_ENTITY, ELEMENT_ENTITY_LISTENER, ELEMENT_ENTITY_LISTENERS, ELEMENT_ENTITY_MAPPINGS, ELEMENT_ENTITY_RESULT, ELEMENT_ENUMERATED, ELEMENT_EXCLUDE_DEFAULT_LISTENERS, ELEMENT_EXCLUDE_SUPERCLASS_LISTENERS, ELEMENT_FIELD_RESULT, ELEMENT_GENERATED_VALUE, ELEMENT_HINT, ELEMENT_ID, ELEMENT_ID_CLASS, ELEMENT_INHERITANCE, ELEMENT_INVERSE_JOIN_COLUMN, ELEMENT_JOIN_COLUMN, ELEMENT_JOIN_TABLE, ELEMENT_LOB, ELEMENT_LOCK_MODE, ELEMENT_MANY_TO_MANY, ELEMENT_MANY_TO_ONE, ELEMENT_MAP_KEY, ELEMENT_MAP_KEY_ATTRIBUTE_OVERRIDE, ELEMENT_MAP_KEY_CLASS, ELEMENT_MAP_KEY_COLUMN, ELEMENT_MAP_KEY_ENUMERATED, ELEMENT_MAP_KEY_TEMPORAL, ELEMENT_MAPPED_SUPERCLASS, ELEMENT_NAMED_NATIVE_QUERY, ELEMENT_NAMED_QUERY, ELEMENT_ONE_TO_MANY, ELEMENT_ONE_TO_ONE, ELEMENT_ORDER_BY, ELEMENT_ORDER_COLUMN, ELEMENT_PERSISTENCE_UNIT_DEFAULTS, ELEMENT_PERSISTENT_UNIT_METADATA, ELEMENT_POST_LOAD, ELEMENT_POST_PERSIST, ELEMENT_POST_REMOVE, ELEMENT_POST_UPDATE, ELEMENT_PRE_PERSIST, ELEMENT_PRE_REMOVE, ELEMENT_PRE_UPDATE, ELEMENT_PRIMARY_KEY_JOIN_COLUMN, ELEMENT_QUERY, ELEMENT_SCHEMA, ELEMENT_SECONDARY_TABLE, ELEMENT_SEQUENCE_GENERATOR, ELEMENT_SQL_RESULT_SET_MAPPING, ELEMENT_TABLE, ELEMENT_TABLE_GENERATOR, ELEMENT_TEMPORAL, ELEMENT_TRANSIENT, ELEMENT_UNIQUE_CONSTRAINT, ELEMENT_VERSION, ELEMENT_XML_MAPPING_METADATA_COMPLETE, EMPTY, FALSE| Constructor and Description |
|---|
Element(ParentElement parent,
Map<String,String> attributes,
String[] expectedChildElements) |
| Modifier and Type | Method and Description |
|---|---|
void |
cdata(String cdata)
Registers the character data of the element with the element factory;
|
void |
end()
Creates the element and hands over to the parent.
|
void |
expected(String element,
Locator locator)
Checks if the
element is expected. |
static Element |
forElement(Element parent,
Map<String,String> attributes,
XmlLocator xmlLocator)
Constructs and Element for the
element |
protected void |
generate()
Generates the elements artifact.
|
protected String |
getAttribute(String name)
Returns the attribute value for the
name. |
protected boolean |
getAttribute(String name,
boolean devault)
Returns the boolean attribute value for the
name. |
protected int |
getAttribute(String name,
int devault)
Returns the integer attribute value for the
name. |
protected String |
getAttribute(String name,
String devault)
Returns the attribute value for the
name. |
Set<String> |
getExpectedChildElements()
Returns the expectedChildElements of the Element.
|
XmlLocator |
getLocator()
Returns the locator.
|
ParentElement |
getParent()
Returns the parent of the Element.
|
public Element(ParentElement parent, Map<String,String> attributes, String[] expectedChildElements)
parent - the parent element factoryattributes - the attributesexpectedChildElements - the name of the elements expectedpublic static Element forElement(Element parent, Map<String,String> attributes, XmlLocator xmlLocator)
elementparent - the parent elementattributes - the attributes of the elementxmlLocator - the XML locator of the elementpublic void cdata(String cdata)
cdata - the character datapublic void end()
if the parent is null, that the factory is EntityMappings, the model element is added to the metamodel.
public void expected(String element, Locator locator) throws MappingException
element is expected.element - the name of the elementlocator - the XML locatorMappingException - thrown if the element is not expected.protected void generate()
Element factories implement the method to generate their artifacts.
protected String getAttribute(String name)
name.name - the name of the attributeprotected boolean getAttribute(String name, boolean devault)
name.name - the name of the attributedevault - the default valueprotected int getAttribute(String name, int devault)
name.name - the name of the attributedevault - the default valueprotected String getAttribute(String name, String devault)
name.name - the name of the attributedevault - the default valuepublic Set<String> getExpectedChildElements()
public XmlLocator getLocator()
getLocator in interface LocatableMatadatapublic ParentElement getParent()
Copyright © 2012-2013 Batoo. All Rights Reserved.