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!"); } }
log.trace(e.getMessage());
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 AttributeBinding addAttribute(QName name, TypeBinding type, AttributeHandler handler) { throw new JBossXBRuntimeException("Simple types can't have attributes."); }
public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle) { if(parent instanceof XOPElementHandler.XOPElement) { ((XOPElementHandler.XOPElement)parent).value = o; } else { throw new JBossXBRuntimeException("Expected XOPElement as a parent but got " + parent + " for element " + elementName); } } }
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); } }
throw new JBossXBRuntimeException("The cursor in all group has not been positioned yet!"); throw new JBossXBRuntimeException("Failed to process endElement for " + qName + " since the current element is " + (curParticle == null ? null : getElement().getQName()) );
private static void invokeSetter(Method setValueMethod, Object parent, Object o, String setValueMethodName) { try { setValueMethod.invoke(parent, new Object[]{o}); } catch(Exception e) { throw new JBossXBRuntimeException("Failed to invoke " + setValueMethodName + " on " + parent + " with parameter " + o + ": " + e.getMessage() ); } }