public ElementBinding(SchemaBinding schema, QName qName, TypeBinding typeBinding) { super(schema); this.qName = qName; this.typeBinding = typeBinding; if(qName == null) { throw new JBossXBRuntimeException("Each element must have a non-null QName!"); } }
public ParticleBinding getCurrentParticle() { if(curParticle == null) { throw new JBossXBRuntimeException("The cursor in all group has not been positioned yet!"); } return curParticle; }
public AttributeBinding(SchemaBinding schema, QName qName, TypeBinding type, AttributeHandler handler) { this.schema = schema; this.qName = qName; this.type = type; this.handler = handler; if(qName == null) { throw new JBossXBRuntimeException("Each attribute should have a non-null QName!"); } }
public void addElement(QName qName, ElementBinding binding) { throw new JBossXBRuntimeException("Simple types can't have child elements."); } }
public void setProcessContents(short pc) { this.pc = pc; if(pc != PC_LAX && pc != PC_SKIP && pc != PC_STRICT) { throw new JBossXBRuntimeException("Unexpected value for process contents: " + pc); } }
public void setValue(Object value) { if(this.value != null) { throw new JBossXBRuntimeException( "The value is already set: current value=" + this.value + ", overriding value=" + value ); } this.value = value; }
public ElementBinding getElement() { if(pos < 0) { throw new JBossXBRuntimeException( "The cursor has not been positioned yet! startElement should be called." ); } return element; }
public ElementBinding getElement() { if(pos < 0) { throw new JBossXBRuntimeException( "The cursor has not been positioned yet! startElement should be called." ); } return element; }
public void setKey(Object key) { if(this.key != null) { throw new JBossXBRuntimeException( "The key is already set: current value=" + this.key + ", overriding value=" + key ); } this.key = key; }
public void setProperty(String name, Object value) { try { reader.setProperty(name, value); } catch(SAXException e) { throw new JBossXBRuntimeException("Failed to set property on the XML reader", e); } }
public void setFeature(String name, boolean value) { try { reader.setFeature(name, value); } catch(SAXException e) { throw new JBossXBRuntimeException("Failed to set feature on the XMLReader", e); } }
public ParticleBinding getCurrentParticle() { if(pos < 0) { throw new JBossXBRuntimeException( "The cursor has not been positioned yet! startElement should be called." ); } return (ParticleBinding)choices.get(pos); }
public ParticleBinding getCurrentParticle() { if(pos < 0) { throw new JBossXBRuntimeException( "The cursor has not been positioned yet! startElement should be called." ); } return (ParticleBinding)sequence.get(pos); }
private void popModelGroup() { Object o = typeGroupStack.remove(typeGroupStack.size() - 1); if(!(o instanceof ModelGroupBinding)) { throw new JBossXBRuntimeException("Should have poped model group binding but got " + o); } }
private void popType() { Object o = typeGroupStack.remove(typeGroupStack.size() - 1); if(!(o instanceof TypeBinding)) { throw new JBossXBRuntimeException("Should have poped type binding but got " + o); } }
public boolean isTypeComplex() { if(currentElementType == null) { throw new JBossXBRuntimeException("There is no current element!"); } return currentElementType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE; }
public Object instantiate() { try { ModelMBeanAttributeInfo info = buildAttributeInfo(); return info; } catch(NotCompliantMBeanException e) { throw new JBossXBRuntimeException(e); } }
public boolean isAttributeRequired() { if(currentAttribute == null) { throw new JBossXBRuntimeException("There is no current attribute!"); } return currentAttribute.getRequired(); }
public Object instantiate() { try { ModelMBeanAttributeInfo info = buildAttributeInfo(); return info; } catch(NotCompliantMBeanException e) { throw new JBossXBRuntimeException(e); } }
public void endElement(QName qName) { if(curParticle == null || !getElement().getQName().equals(qName)) { throw new JBossXBRuntimeException("Failed to process endElement for " + qName + " since the current element is " + (curParticle == null ? null : getElement().getQName()) ); } }