sk.uniba.euromath.document.schema
Class DocumentSchema

java.lang.Object
  extended by sk.uniba.euromath.document.schema.DocumentSchema

public class DocumentSchema
extends Object

Document's content modifier helper. For chosen operation returns all possibilities, that will result in valid document. Not intended to be subclassed nor instantiated by clients.

Author:
Martin Vysny

Constructor Summary
DocumentSchema(DomCore doc)
          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.
 boolean isDeletableAttribute(Attr attribute)
          Checks, whether given attribute is deletable from its element.
 void validate()
          Validates this document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentSchema

public DocumentSchema(DomCore doc)
Constructor. Not intended to be used by clients.

Parameters:
doc - the document instance.
Method Detail

getElementRule

public ElementRule getElementRule(Element element)
Returns rule for given element. It can be further queried for various info.

Parameters:
element - the context element, for which rule will be created.
Returns:
instance of element rule

isDeletableAttribute

public boolean isDeletableAttribute(Attr attribute)
Checks, whether given attribute is deletable from its element. It is OK to use this function. However, for subsequent queries to attribute's element please use ElementRule instance, it's more effective.

Parameters:
attribute - attribute to check.
Returns:
false if attribute is not deletable.

getAttributeRule

public AttributeRule getAttributeRule(Attr attribute)
Gets attribute rule for given attribute. It can be used to validate textual value of attribute. It is OK to use this function. However, for subsequent queries to attribute's element please use ElementRule instance, it's more effective.

Parameters:
attribute - return rule for this attribute.
Returns:
rule for this attribute.

validate

public void validate()
              throws SchemaException
Validates this document.

Throws:
SchemaException - if something goes wrong in the process of validation.

getRefs

public SchemaReferences getRefs()
Returns object containing references to loaded schema objects.

Returns:
schema references object


Copyright © 2003-2006 null. All Rights Reserved.