|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.baka.xml.schematic.DocumentSchema
public class DocumentSchema
DOM Document's content helper. For chosen operation returns all
possibilities, that will result in valid document. Holds its own instance of
SchemaReferences
object.
Field Summary | |
---|---|
Document |
doc
The document instance. |
protected SchemaReferences |
refs
References instance. |
Constructor Summary | |
---|---|
DocumentSchema(Document doc,
SchemaPool pool)
Constructor. |
Method Summary | |
---|---|
AttributeRule |
getAttributeRule(Attr attribute)
Gets attribute rule for given attribute. |
ElementRule |
getElementRule(Element element)
Returns rule for given element. |
SchemaReferences |
getRefs()
Returns object containing references to loaded schema objects. |
String |
isDeletableAttribute(Attr attribute)
Checks, whether given attribute is deletable from its element. |
void |
loadSchemas()
Loads schemas for all given namespaces. |
void |
validate()
Validates this document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Document doc
protected final SchemaReferences refs
Constructor Detail |
---|
public DocumentSchema(Document doc, SchemaPool pool)
doc
- the document instance.pool
- the schema pool.Method Detail |
---|
public void loadSchemas() throws SchemaException, IOException
SchemaException
- if error happens during loading of schemas.
IOException
- if i/o error occurs during the schema files
deserialization.public ElementRule getElementRule(Element element)
element
- the context element, for which rule will be created.
public String isDeletableAttribute(Attr attribute)
ElementRule.isDeletableAttribute(Attr)
.
attribute
- attribute to check.
null
if attribute is deletable, error message
otherwise.public AttributeRule getAttributeRule(Attr attribute)
ElementRule
instance, it's more effective.
attribute
- return rule for this attribute.
public void validate() throws SchemaException
SchemaException
- if something goes wrong in the process of
validation.public SchemaReferences getRefs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |