Methods Summary |
---|
public org.apache.xerces.impl.dtd.models.CMNode | getCMBinOpNode(int type, org.apache.xerces.impl.dtd.models.CMNode leftNode, org.apache.xerces.impl.dtd.models.CMNode rightNode)
nodeCountCheck() ;
return new XSCMBinOp(type, leftNode, rightNode) ;
|
public org.apache.xerces.impl.dtd.models.CMNode | getCMLeafNode(int type, java.lang.Object leaf, int id, int position)
nodeCountCheck();
return new XSCMLeaf(type, leaf, id, position) ;
|
public org.apache.xerces.impl.dtd.models.CMNode | getCMRepeatingLeafNode(int type, java.lang.Object leaf, int minOccurs, int maxOccurs, int id, int position)
nodeCountCheck();
return new XSCMRepeatingLeaf(type, leaf, minOccurs, maxOccurs, id, position);
|
public org.apache.xerces.impl.dtd.models.CMNode | getCMUniOpNode(int type, org.apache.xerces.impl.dtd.models.CMNode childNode)
nodeCountCheck();
return new XSCMUniOp(type, childNode) ;
|
public void | nodeCountCheck()
if( fSecurityManager != null && nodeCount++ > maxNodeLimit){
if(DEBUG){
System.out.println("nodeCount = " + nodeCount ) ;
System.out.println("nodeLimit = " + maxNodeLimit ) ;
}
fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "maxOccurLimit", new Object[]{ new Integer(maxNodeLimit) }, XMLErrorReporter.SEVERITY_FATAL_ERROR);
// similarly to entity manager behaviour, take into accont
// behaviour if continue-after-fatal-error is set.
nodeCount = 0;
}
|
public void | reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
try {
fSecurityManager = (SecurityManager)componentManager.getProperty(SECURITY_MANAGER);
//we are setting the limit of number of nodes to 3times the maxOccur value..
if(fSecurityManager != null){
maxNodeLimit = fSecurityManager.getMaxOccurNodeLimit() * MULTIPLICITY ;
}
}
catch (XMLConfigurationException e) {
fSecurityManager = null;
}
|
public void | resetNodeCount()
nodeCount = 0 ;
|
public void | setProperty(java.lang.String propertyId, java.lang.Object value)Sets the value of a property. This method is called by the component
manager any time after reset when a property changes value.
Note: Components should silently ignore properties
that do not affect the operation of the component.
// Xerces properties
if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
if (suffixLength == Constants.SECURITY_MANAGER_PROPERTY.length() &&
propertyId.endsWith(Constants.SECURITY_MANAGER_PROPERTY)) {
fSecurityManager = (SecurityManager)value;
maxNodeLimit = (fSecurityManager != null) ? fSecurityManager.getMaxOccurNodeLimit() * MULTIPLICITY : 0 ;
return;
}
if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() &&
propertyId.endsWith(Constants.ERROR_REPORTER_PROPERTY)) {
fErrorReporter = (XMLErrorReporter)value;
return;
}
}
|