public class HibernateInspector extends BaseXmlInspector
mLog| Constructor and Description |
|---|
HibernateInspector(HibernateInspectorConfig config) |
| Modifier and Type | Method and Description |
|---|---|
protected Element |
getDocumentElement(ResourceResolver resolver,
InputStream... files)
Overridden to automatically drill into Hibernate Configuration files.
|
protected String |
getExtendsAttribute()
Hibernate supports
extends via its <subclass> element. |
protected String |
getTopLevelTypeAttribute()
Overridden to search by
name=, not type=. |
protected String |
getTypeAttribute()
The attribute on child elements that identifies another top-level element.
|
protected Map<String,String> |
inspectProperty(Element toInspect)
Inspect the given Element and return a Map of attributes if it is a property.
|
protected void |
preprocessDocument(Document document)
Prepend 'package' attribute to class 'name' and 'extends' attributes, and to 'class'
attributes of children.
|
getDocumentElement, getNameAttribute, getReferenceAttribute, inspect, inspectAction, inspectAsDom, inspectTrait, inspectTraits, inspectTraitSiblings, traverse, traverseFromTopLevelTypeToNamedChildrenpublic HibernateInspector(HibernateInspectorConfig config)
protected String getTopLevelTypeAttribute()
name=, not type=.getTopLevelTypeAttribute in class BaseXmlInspectorprotected String getTypeAttribute()
BaseXmlInspector
This is necessary for path traversal. If an XML format does not specify a way to traverse
from a child to another top-level element, the Inspector cannot find information along paths
(eg. foo/bar/baz). There is a way around this but, on balance, we
decided against it (see http://blog.kennardconsulting.com/2008/01/ask-your-father.html).
getTypeAttribute in class BaseXmlInspectorprotected String getExtendsAttribute()
extends via its <subclass> element.getExtendsAttribute in class BaseXmlInspectorprotected Element getDocumentElement(ResourceResolver resolver, InputStream... files) throws Exception
getDocumentElement in class BaseXmlInspectorresolver - helper in case getDocumentElement needs to resolve references defined
in the InputStream.Exceptionprotected void preprocessDocument(Document document)
preprocessDocument in class BaseXmlInspectordocument - DOM of XML being processedprotected Map<String,String> inspectProperty(Element toInspect)
BaseXmlInspectorIt is this method's responsibility to decide whether the given Element does, in fact, qualify as a 'property' - based on its own rules. Does nothing by default.
inspectProperty in class BaseXmlInspectortoInspect - DOM element to inspectCopyright © 2015. All Rights Reserved.