congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Dom4JElementMapper
Code IndexAdd Tabnine to your IDE (free)

How to use
Dom4JElementMapper
in
org.jibx.extras

Best Java code snippets using org.jibx.extras.Dom4JElementMapper (Showing top 2 results out of 315)

origin: org.jibx/jibx-extras

  public Object unmarshal(Object obj, IUnmarshallingContext ictx)
    throws JiBXException {
    
    // verify the entry conditions
    if (!(ictx instanceof UnmarshallingContext)) {
      throw new JiBXException
        ("Unmarshalling context not of expected type");
    } else if (m_name != null && !ictx.isAt(m_uri, m_name)) {
      ((UnmarshallingContext)ictx).throwStartTagNameError(m_uri, m_name);
    }
    
    // position to element start tag
    m_unmarshalContext = (UnmarshallingContext)ictx;
    m_unmarshalContext.toStart();
    
    // unmarshal element to document model
    try {
      return unmarshalElement();
    } catch (IOException e) {
      throw new JiBXException("Error reading from document", e);
    }
  }
}
origin: org.jibx/jibx-extras

public void marshal(Object obj, IMarshallingContext ictx)
  throws JiBXException {
  
  // make sure the parameters are as expected
  if (!(obj instanceof Element)) {
    throw new JiBXException("Mapped object not an org.dom4j.Element");
  } else {
    try {
        
      // marshal element and all content with only leading indentation
      m_xmlWriter = ictx.getXmlWriter();
      m_xmlWriter.indent();
      int indent = ictx.getIndent();
      ictx.setIndent(-1);
      m_defaultNamespaceURI = null;
      marshalElement((Element)obj);
      ictx.setIndent(indent);
      
    } catch (IOException e) {
      throw new JiBXException("Error writing to document", e);
    }
  }
}
org.jibx.extrasDom4JElementMapper

Javadoc

Custom element marshaller/unmarshaller to dom4j representation. This allows you to mix data binding and document model representations for XML within the same application. You simply use this marshaller/unmarshaller with a linked object type of org.dom4j.Element (the actual runtime type - the declared type is ignored and can be anything). If a name is supplied on a reference that element name will always be matched when unmarshalling but will be ignored when marshalling (with the actual dom4j element name used). If no name is supplied this will unmarshal a single element with any name.

Most used methods

  • marshalElement
  • unmarshalElement

Popular in Java

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JFrame (javax.swing)
  • JLabel (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now