jInfer

cz.cuni.mff.ksi.jinfer.xsdimportsax
Class SAXHelper

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.xsdimportsax.SAXHelper

public final class SAXHelper
extends Object

Helper class for DOMHandler , provides convenience methods used during parsing. It is best NOT to use these methods outside this package. Please read package info.


Method Summary
static void finalizeElement(Element elem)
          Finalizes the element, makes it immutable.
static boolean isContainer(Element elem)
          Finds out if parameter is only a temporary container with the name set by CONTAINER_NAME constant.
static Map<String,Object> prepareAttributeMetadata(SAXDocumentElement el)
          Prepare metadata of attribute tag stored in the parameter.
static Map<String,Object> prepareElementMetadata(SAXDocumentElement el, boolean isContainer)
          Prepares the metadata for a rule by extracting information from el.
static String prepareElementName(SAXDocumentElement el, boolean isContainer)
          Prepares the name for a rule by extracting data from el .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

prepareAttributeMetadata

public static Map<String,Object> prepareAttributeMetadata(SAXDocumentElement el)
Prepare metadata of attribute tag stored in the parameter. If the parameter has a defined attribute use, add this information to metadata.

Parameters:
el - Instance of the wrapper class containing the attribute tag, from which the metadata is extracted.
Returns:
New metadata.

isContainer

public static boolean isContainer(Element elem)
Finds out if parameter is only a temporary container with the name set by CONTAINER_NAME constant.

Parameters:
elem - Instance to be examined.
Returns:
True if elem is a container, false otherwise.

prepareElementName

public static String prepareElementName(SAXDocumentElement el,
                                        boolean isContainer)
Prepares the name for a rule by extracting data from el . Resulting name is taken from attributes of the tag. Attribute name has priority before attribute ref. If it is a container, special internal value for the name is used.

Parameters:
el - Instance wrapping the tag.
isContainer - Indicates if the name is prepared only for a container.
Returns:
New name for the rule.

prepareElementMetadata

public static Map<String,Object> prepareElementMetadata(SAXDocumentElement el,
                                                        boolean isContainer)
Prepares the metadata for a rule by extracting information from el. If it is not a container, IGGUtils.ATTR_FROM_SCHEMA is added to metadata. If el has ref attribute specified, IGGUtils.METADATA_SENTINEL is added to metadata.

Parameters:
el - Instance wrapping the tag.
isContainer - Indicates if the metadata is prepared only for a container.
Returns:
New metadata.

finalizeElement

public static void finalizeElement(Element elem)
Finalizes the element, makes it immutable. Should be called only when all type dependencies have been resolved.

Parameters:
elem - Element to finalize.

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011