本文整理汇总了Java中com.helger.xml.microdom.MicroElement类的典型用法代码示例。如果您正苦于以下问题:Java MicroElement类的具体用法?Java MicroElement怎么用?Java MicroElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MicroElement类属于com.helger.xml.microdom包,在下文中一共展示了MicroElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertToMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
public IMicroElement convertToMicroElement (final PModeLeg aValue, final String sNamespaceURI, final String sTagName)
{
final IMicroElement ret = new MicroElement (sNamespaceURI, sTagName);
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getProtocol (), sNamespaceURI, ELEMENT_PROTOCOL));
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getBusinessInfo (),
sNamespaceURI,
ELEMENT_BUSINESS_INFORMATION));
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getErrorHandling (),
sNamespaceURI,
ELEMENT_ERROR_HANDLING));
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getReliability (),
sNamespaceURI,
ELEMENT_RELIABILITY));
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getSecurity (), sNamespaceURI, ELEMENT_SECURITY));
return ret;
}
示例2: convertToMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
public IMicroElement convertToMicroElement (final PModeLegBusinessInformation aValue,
final String sNamespaceURI,
final String sTagName)
{
final IMicroElement ret = new MicroElement (sNamespaceURI, sTagName);
ret.setAttribute (ATTR_SERVICE, aValue.getService ());
ret.setAttribute (ATTR_ACTION, aValue.getAction ());
aValue.forAllProperties (x -> ret.appendChild (MicroTypeConverter.convertToMicroElement (x,
sNamespaceURI,
ELEMENT_PROPERTIES)));
aValue.forAllPayloadProfiles (x -> ret.appendChild (MicroTypeConverter.convertToMicroElement (x,
sNamespaceURI,
ELEMENT_PAYLOAD_PROFILE)));
if (aValue.getPayloadProfileMaxKB () != null)
ret.setAttribute (ATTR_PAYLOAD_PROFILE_MAX_KB, aValue.getPayloadProfileMaxKB ());
ret.setAttribute (ATTR_MPCID, aValue.getMPCID ());
return ret;
}
示例3: convertToMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
public IMicroElement convertToMicroElement (final PModeLegErrorHandling aValue,
final String sNamespaceURI,
final String sTagName)
{
final IMicroElement ret = new MicroElement (sNamespaceURI, sTagName);
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getReportReceiverErrorsTo (),
sNamespaceURI,
ELEMENT_REPORT_RECEIVER_ERRORS_TO));
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getReportSenderErrorsTo (),
sNamespaceURI,
ELEMENT_REPORT_SENDER_ERRORS_TO));
if (aValue.isReportAsResponseDefined ())
ret.setAttribute (ATTR_REPORT_AS_RESPONSE, aValue.isReportAsResponse ());
if (aValue.isReportProcessErrorNotifyConsumerDefined ())
ret.setAttribute (ATTR_REPORT_PROCESS_ERROR_NOTFIY_CONSUMER, aValue.isReportProcessErrorNotifyConsumer ());
if (aValue.isReportProcessErrorNotifyProducerDefined ())
ret.setAttribute (ATTR_REPORT_PROCESS_ERROR_NOTFIY_PRODUCER, aValue.isReportProcessErrorNotifyProducer ());
if (aValue.isReportDeliveryFailuresNotifyProducerDefined ())
ret.setAttribute (ATTR_REPORT_DELIVERY_FAILURE_NOTFIY_PRODUCER, aValue.isReportDeliveryFailuresNotifyProducer ());
return ret;
}
示例4: convertToMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement convertToMicroElement (@Nonnull final PMode aValue,
@Nullable final String sNamespaceURI,
@Nonnull final String sTagName)
{
final IMicroElement ret = new MicroElement (sNamespaceURI, sTagName);
setObjectFields (aValue, ret);
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getInitiator (),
sNamespaceURI,
ELEMENT_INITIATOR));
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getResponder (),
sNamespaceURI,
ELEMENT_RESPONDER));
ret.setAttribute (ATTR_AGREEMENT, aValue.getAgreement ());
ret.setAttribute (ATTR_MEP, aValue.getMEPID ());
ret.setAttribute (ATTR_MEP_BINDING, aValue.getMEPBindingID ());
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getLeg1 (), sNamespaceURI, ELEMENT_LEG1));
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getLeg2 (), sNamespaceURI, ELEMENT_LEG2));
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getPayloadService (),
sNamespaceURI,
ELEMENT_PAYLOADSERVICE));
ret.appendChild (MicroTypeConverter.convertToMicroElement (aValue.getReceptionAwareness (),
sNamespaceURI,
ELEMENT_RECEPETIONAWARENESS));
return ret;
}
示例5: convertToMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement convertToMicroElement (@Nonnull final T aObject,
@Nullable final String sNamespaceURI,
@Nonnull final String sTagName)
{
final IMicroElement eRoot = new MicroElement (sNamespaceURI, sTagName);
eRoot.setAttribute (ATTR_NAME, aObject.getName ());
// Sort fields to have them deterministic
for (final Map.Entry <String, Object> aEntry : aObject.getSortedByKey (Comparator.naturalOrder ()).entrySet ())
{
final String sFieldName = aEntry.getKey ();
final Object aValue = aEntry.getValue ();
final IMicroElement eSetting = eRoot.appendElement (sNamespaceURI, ELEMENT_SETTING);
eSetting.setAttribute (ATTR_NAME, sFieldName);
eSetting.setAttribute (ATTR_CLASS, aValue.getClass ().getName ());
eSetting.appendChild (MicroTypeConverter.convertToMicroElement (aValue, ELEMENT_VALUE));
}
return eRoot;
}
示例6: testGetXHTMLString
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Test
public void testGetXHTMLString ()
{
final IMicroDocument aDoc = MicroReader.readMicroXML (TEST_XML);
_testGetNodeAsXHTMLString (aDoc);
_testGetNodeAsXHTMLString (aDoc.getDocumentElement ());
_testGetNodeAsXHTMLString (new MicroDocument ());
_testGetNodeAsXHTMLString (new MicroElement ("xyz"));
_testGetNodeAsXHTMLString (new MicroContainer ());
_testGetNodeAsXHTMLString (new MicroComment ("useless"));
_testGetNodeAsXHTMLString (new MicroEntityReference ("xyz"));
try
{
_testGetNodeAsXHTMLString (null);
fail ();
}
catch (final NullPointerException ex)
{}
}
示例7: testGetChildTextContentWithConversionAndNS
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Test
public void testGetChildTextContentWithConversionAndNS ()
{
final String sNSURI = "my-namespace-uri";
final IMicroElement e = new MicroElement (sNSURI, "x");
assertNull (MicroHelper.getChildTextContentWithConversion (e, sNSURI, "y", BigInteger.class));
final IMicroElement y = e.appendElement (sNSURI, "y");
assertNull (MicroHelper.getChildTextContentWithConversion (e, sNSURI, "y", BigInteger.class));
y.appendText ("100");
assertEquals (CGlobal.BIGINT_100, MicroHelper.getChildTextContentWithConversion (e, sNSURI, "y", BigInteger.class));
y.appendElement ("a");
assertEquals (CGlobal.BIGINT_100, MicroHelper.getChildTextContentWithConversion (e, sNSURI, "y", BigInteger.class));
y.appendCDATA ("234");
assertEquals (BigInteger.valueOf (100234),
MicroHelper.getChildTextContentWithConversion (e, sNSURI, "y", BigInteger.class));
}
示例8: convertToMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement convertToMicroElement (@Nonnull final PostalAddress aAddress,
@Nullable final String sNamespaceURI,
@Nonnull final String sTagName)
{
final IMicroElement eAddress = new MicroElement (sNamespaceURI, sTagName);
if (aAddress.getType () != null)
eAddress.setAttribute (ATTR_TYPE, aAddress.getType ().getID ());
if (StringHelper.hasText (aAddress.getCountry ()))
eAddress.setAttribute (ATTR_COUNTRY, aAddress.getCountry ());
if (StringHelper.hasText (aAddress.getState ()))
eAddress.setAttribute (ATTR_STATE, aAddress.getState ());
if (StringHelper.hasText (aAddress.getPostalCode ()))
eAddress.setAttribute (ATTR_POSTALCODE, aAddress.getPostalCode ());
if (StringHelper.hasText (aAddress.getCity ()))
eAddress.setAttribute (ATTR_CITY, aAddress.getCity ());
if (StringHelper.hasText (aAddress.getStreet ()))
eAddress.setAttribute (ATTR_STREET, aAddress.getStreet ());
if (StringHelper.hasText (aAddress.getBuildingNumber ()))
eAddress.setAttribute (ATTR_BUILDINGNUMBER, aAddress.getBuildingNumber ());
if (StringHelper.hasText (aAddress.getPostOfficeBox ()))
eAddress.setAttribute (ATTR_POBOX, aAddress.getPostOfficeBox ());
if (StringHelper.hasText (aAddress.getCareOf ()))
eAddress.setAttribute (ATTR_CARE_OF, aAddress.getCareOf ());
return eAddress;
}
示例9: convertToMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement convertToMicroElement (@Nonnull final PersonName aValue,
@Nullable final String sNamespaceURI,
@Nonnull final String sTagName)
{
final IMicroElement eName = new MicroElement (sNamespaceURI, sTagName);
if (aValue.getSalutation () != null)
eName.setAttribute (ATTR_SALUTATION, aValue.getSalutationID ());
if (StringHelper.hasText (aValue.getPrefixTitle ()))
eName.setAttribute (ATTR_PREFIXTITLE, aValue.getPrefixTitle ());
if (StringHelper.hasText (aValue.getFirstName ()))
eName.setAttribute (ATTR_FIRSTNAME, aValue.getFirstName ());
if (StringHelper.hasText (aValue.getMiddleName ()))
eName.setAttribute (ATTR_MIDDLENAME, aValue.getMiddleName ());
if (StringHelper.hasText (aValue.getLastName ()))
eName.setAttribute (ATTR_LASTNAME, aValue.getLastName ());
if (StringHelper.hasText (aValue.getSuffixTitle ()))
eName.setAttribute (ATTR_SUFFIXTITLE, aValue.getSuffixTitle ());
return eName;
}
示例10: getAsMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement getAsMicroElement ()
{
final IMicroElement ret = new MicroElement (CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_PHASE);
ret.setAttribute (CSchematronXML.ATTR_ID, m_sID);
if (m_aRich != null)
m_aRich.fillMicroElement (ret);
if (m_aForeignElements != null)
for (final IMicroElement aForeignElement : m_aForeignElements)
ret.appendChild (aForeignElement.getClone ());
for (final PSInclude aInclude : m_aIncludes)
ret.appendChild (aInclude.getAsMicroElement ());
for (final IPSElement aContent : m_aContent)
ret.appendChild (aContent.getAsMicroElement ());
if (m_aForeignAttrs != null)
for (final Map.Entry <String, String> aEntry : m_aForeignAttrs.entrySet ())
ret.setAttribute (aEntry.getKey (), aEntry.getValue ());
return ret;
}
示例11: getAsMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement getAsMicroElement ()
{
final IMicroElement ret = new MicroElement (CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_P);
ret.setAttribute (CSchematronXML.ATTR_ID, m_sID);
ret.setAttribute (CSchematronXML.ATTR_CLASS, m_sClass);
ret.setAttribute (CSchematronXML.ATTR_ICON, m_sIcon);
if (m_aForeignElements != null)
for (final IMicroElement aForeignElement : m_aForeignElements)
ret.appendChild (aForeignElement.getClone ());
for (final Object aContent : m_aContent)
if (aContent instanceof String)
ret.appendText ((String) aContent);
else
ret.appendChild (((IPSElement) aContent).getAsMicroElement ());
if (m_aForeignAttrs != null)
for (final Map.Entry <String, String> aEntry : m_aForeignAttrs.entrySet ())
ret.setAttribute (aEntry.getKey (), aEntry.getValue ());
return ret;
}
示例12: getAsMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement getAsMicroElement ()
{
final IMicroElement ret = new MicroElement (CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_PATTERN);
if (m_bAbstract)
ret.setAttribute (CSchematronXML.ATTR_ABSTRACT, "true");
ret.setAttribute (CSchematronXML.ATTR_ID, m_sID);
ret.setAttribute (CSchematronXML.ATTR_IS_A, m_sIsA);
if (m_aRich != null)
m_aRich.fillMicroElement (ret);
if (m_aForeignElements != null)
for (final IMicroElement aForeignElement : m_aForeignElements)
ret.appendChild (aForeignElement.getClone ());
for (final PSInclude aInclude : m_aIncludes)
ret.appendChild (aInclude.getAsMicroElement ());
if (m_aTitle != null)
ret.appendChild (m_aTitle.getAsMicroElement ());
for (final IPSElement aContent : m_aContent)
ret.appendChild (aContent.getAsMicroElement ());
if (m_aForeignAttrs != null)
for (final Map.Entry <String, String> aEntry : m_aForeignAttrs.entrySet ())
ret.setAttribute (aEntry.getKey (), aEntry.getValue ());
return ret;
}
示例13: getAsMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement getAsMicroElement ()
{
final IMicroElement ret = new MicroElement (CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_DIAGNOSTIC);
ret.setAttribute (CSchematronXML.ATTR_ID, m_sID);
if (m_aRich != null)
m_aRich.fillMicroElement (ret);
if (m_aForeignElements != null)
for (final IMicroElement aForeignElement : m_aForeignElements)
ret.appendChild (aForeignElement.getClone ());
for (final Object aContent : m_aContent)
if (aContent instanceof String)
ret.appendText ((String) aContent);
else
ret.appendChild (((IPSElement) aContent).getAsMicroElement ());
if (m_aForeignAttrs != null)
for (final Map.Entry <String, String> aEntry : m_aForeignAttrs.entrySet ())
ret.setAttribute (aEntry.getKey (), aEntry.getValue ());
return ret;
}
示例14: getAsMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement getAsMicroElement ()
{
final IMicroElement ret = new MicroElement (CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_DIAGNOSTICS);
if (m_aForeignElements != null)
for (final IMicroElement aForeignElement : m_aForeignElements)
ret.appendChild (aForeignElement.getClone ());
for (final PSInclude aInclude : m_aIncludes)
ret.appendChild (aInclude.getAsMicroElement ());
for (final PSDiagnostic aDiagnostic : m_aDiagnostics)
ret.appendChild (aDiagnostic.getAsMicroElement ());
if (m_aForeignAttrs != null)
for (final Map.Entry <String, String> aEntry : m_aForeignAttrs.entrySet ())
ret.setAttribute (aEntry.getKey (), aEntry.getValue ());
return ret;
}
示例15: getAsMicroElement
import com.helger.xml.microdom.MicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement getAsMicroElement ()
{
final IMicroElement ret = new MicroElement (CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_ACTIVE);
ret.setAttribute (CSchematronXML.ATTR_PATTERN, m_sPattern);
if (m_aForeignElements != null)
for (final IMicroElement aForeignElement : m_aForeignElements)
ret.appendChild (aForeignElement.getClone ());
for (final Object aContent : m_aContent)
if (aContent instanceof String)
ret.appendText ((String) aContent);
else
ret.appendChild (((IPSElement) aContent).getAsMicroElement ());
if (m_aForeignAttrs != null)
for (final Map.Entry <String, String> aEntry : m_aForeignAttrs.entrySet ())
ret.setAttribute (aEntry.getKey (), aEntry.getValue ());
return ret;
}