/** * Build the fully-qualified name for a package or class by appending the supplied name attribute value to the * fully-qualified name of the containing package. * * @param contain * @param ctx * @throws JiBXException */ private String buildFullName(PackageCustom contain, UnmarshallingContext ctx) throws JiBXException { String lead = ""; if (contain != null) { lead = contain.getName() + '.'; } return lead + ctx.attributeText(null, "name"); }
/** * Unmarshalling factory. This gets the containing element and the name so that the standard constructor can be * used. * * @param ictx * @return created instance * @throws JiBXException */ private static OperationCustom factory(IUnmarshallingContext ictx) throws JiBXException { String mname = ((UnmarshallingContext)ictx).attributeText(null, "method-name"); s_logger.debug("Creating operation for operation name " + mname); return new OperationCustom((NestingBase)getContainingObject(ictx), mname); }
/** * Unmarshalling factory. This gets the containing element and the name so that the standard constructor can be * used. * * @param ictx * @return created instance * @throws JiBXException */ private static ServiceCustom factory(IUnmarshallingContext ictx) throws JiBXException { String clas = ((UnmarshallingContext)ictx).attributeText(null, "class"); s_logger.debug("Creating instance for class " + clas); return new ServiceCustom((SharedNestingBase)getContainingObject(ictx), clas); }
/** * Parameter value unmarshalling factory. This gets the containing element and the name so that the standard * constructor can be used. * * @param ictx * @return created instance * @throws JiBXException */ private static ValueCustom parameterFactory(IUnmarshallingContext ictx) throws JiBXException { String name = ((UnmarshallingContext)ictx).attributeText(null, "name"); s_logger.debug("Creating parameter instance with name " + name); return new ValueCustom((OperationCustom)getContainingObject(ictx), name); }
/** * Parameter value unmarshalling factory. This gets the containing element and the name so that the standard * constructor can be used. * * @param ictx * @return created instance * @throws JiBXException */ private static ThrowsCustom throwsFactory(IUnmarshallingContext ictx) throws JiBXException { return new ThrowsCustom((OperationCustom)getContainingObject(ictx), ((UnmarshallingContext)ictx).attributeText( null, "class")); } }
/** * Parameter value unmarshalling factory. This gets the containing element and the name so that the standard * constructor can be used. * * @param ictx * @return created instance * @throws JiBXException */ private static FaultCustom throwsFactory(IUnmarshallingContext ictx) throws JiBXException { UnmarshallingContext uctx = (UnmarshallingContext)ictx; Object parent = uctx.getStackTop(); int depth = 0; if (parent instanceof Collection) { parent = uctx.getStackObject(++depth); } return new FaultCustom((OperationCustom)parent, uctx.attributeText(null, "class")); } }
String check = ctx.attributeText(null, "check-method", null); String dser = ctx.attributeText(null, "deserializer", null); String format = ctx.attributeText(null, "format-name", null); String jclas = ctx.attributeText(null, "java-class", null); String ser = ctx.attributeText(null, "serializer", null); String stype = ctx.attributeText(null, "type-name"); boolean valid = true; if (jclas == null && format == null) {
String cname = ctx.attributeText(null, "class", null); if (cname == null) { vctx.addError("Missing required 'class' attribute", new ProblemLocation(ctx));
String version = m_context.attributeText(m_attributeUri, m_attributeName, m_versionTexts[0]);
Object key = ctx.attributeText(m_uri, KEY_ATTRIBUTE_NAME); String tname = ctx.attributeText(XSI_NAMESPACE_URI, TYPE_ATTRIBUTE_NAME, tdflt);
UnmarshallingContext ctx = (UnmarshallingContext)ictx; ctx.parseToStartTag(null, m_name); obj = createInstance(ctx.attributeText(null, "class", null), ctx); if (obj != null) {
public Object unmarshal(Object obj, IUnmarshallingContext ictx) throws JiBXException { // make sure we're at the appropriate start tag UnmarshallingContext ctx = (UnmarshallingContext)ictx; if (!ctx.isAt(m_uri, m_name)) { return null; } else { // check for reference to existing ID String id = ctx.attributeText(null, getAttributeName(), null); if (id == null) { // no ID value supplied, unmarshal full definition obj = ctx.unmarshalElement(); } else { // find object based on ID obj = ctx.findID(id, 0); ctx.parsePastEndTag(m_uri, m_name); if (obj == null) { ctx.throwStartTagException("Reference to undefined ID " + id); } } } return obj; } }
public Object unmarshal(Object obj, IUnmarshallingContext ictx) throws JiBXException { // make sure we're at the appropriate start tag UnmarshallingContext ctx = (UnmarshallingContext)ictx; if (!ctx.isAt(m_uri, m_name)) { ctx.throwStartTagNameError(m_uri, m_name); } // create new hashmap if needed int size = ctx.attributeInt(m_uri, getSizeAttributeName(), DEFAULT_SIZE); Map map = (Map)obj; if (map == null) { map = new HashMap(size); } // process all entries present in document ctx.parsePastStartTag(m_uri, m_name); while (ctx.isAt(m_uri, getEntryElementName())) { Object key = ctx.attributeText(m_uri, getKeyAttributeName(), null); ctx.parsePastStartTag(m_uri, getEntryElementName()); Object value = ctx.unmarshalElement(); map.put(key, value); ctx.parsePastEndTag(m_uri, getEntryElementName()); } ctx.parsePastEndTag(m_uri, m_name); return map; } }