本文整理汇总了Java中com.helger.xml.microdom.IMicroElement类的典型用法代码示例。如果您正苦于以下问题:Java IMicroElement类的具体用法?Java IMicroElement怎么用?Java IMicroElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMicroElement类属于com.helger.xml.microdom包,在下文中一共展示了IMicroElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertToMicroElement
import com.helger.xml.microdom.IMicroElement; //导入依赖的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.IMicroElement; //导入依赖的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.IMicroElement; //导入依赖的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: convertToNative
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
public PModeLegErrorHandling convertToNative (final IMicroElement aElement)
{
final PModeAddressList aReceiverAddresses = MicroTypeConverter.convertToNative (aElement.getFirstChildElement (ELEMENT_REPORT_RECEIVER_ERRORS_TO),
PModeAddressList.class);
final PModeAddressList aSenderAddresses = MicroTypeConverter.convertToNative (aElement.getFirstChildElement (ELEMENT_REPORT_SENDER_ERRORS_TO),
PModeAddressList.class);
final ETriState eReportAsResponse = getTriState (aElement.getAttributeValue (ATTR_REPORT_AS_RESPONSE),
PModeLegSecurity.DEFAULT_PMODE_AUTHORIZE);
final ETriState eReportProcessErrorNotifyConsumer = getTriState (aElement.getAttributeValue (ATTR_REPORT_PROCESS_ERROR_NOTFIY_CONSUMER),
PModeLegSecurity.DEFAULT_USERNAME_TOKEN_CREATED);
final ETriState eReportProcessErrorNotifyProducer = getTriState (aElement.getAttributeValue (ATTR_REPORT_PROCESS_ERROR_NOTFIY_PRODUCER),
PModeLegSecurity.DEFAULT_USERNAME_TOKEN_DIGEST);
final ETriState eReportDeliveryFailuresNotifyProducer = getTriState (aElement.getAttributeValue (ATTR_REPORT_DELIVERY_FAILURE_NOTFIY_PRODUCER),
PModeLegSecurity.DEFAULT_SEND_RECEIPT);
return new PModeLegErrorHandling (aReceiverAddresses,
aSenderAddresses,
eReportAsResponse,
eReportProcessErrorNotifyConsumer,
eReportProcessErrorNotifyProducer,
eReportDeliveryFailuresNotifyProducer);
}
示例5: convertToMicroElement
import com.helger.xml.microdom.IMicroElement; //导入依赖的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;
}
示例6: PageSecureAllParticipants
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
public PageSecureAllParticipants (@Nonnull @Nonempty final String sID)
{
super (sID, "All participants");
m_aExportAll = addAjax ( (req, res) -> {
final IMicroDocument aDoc = new MicroDocument ();
final IMicroElement aRoot = aDoc.appendElement ("root");
final ICommonsSortedSet <IParticipantIdentifier> aAllIDs = PDMetaManager.getStorageMgr ()
.getAllContainedParticipantIDs ();
for (final IParticipantIdentifier aParticipantID : aAllIDs)
{
final String sParticipantID = aParticipantID.getURIEncoded ();
aRoot.appendElement ("item").appendText (sParticipantID);
}
res.xml (aDoc);
res.attachment ("participant-list.xml");
});
}
示例7: close
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
public void close () throws IOException
{
// Get all remaining objects and save them for late reuse
final ICommonsList <IIndexerWorkItem> aRemainingWorkItems = m_aIndexerWorkQueue.stop ();
if (aRemainingWorkItems.isNotEmpty ())
{
s_aLogger.info ("Persisting " + aRemainingWorkItems.size () + " indexer work items");
final IMicroDocument aDoc = new MicroDocument ();
final IMicroElement eRoot = aDoc.appendElement (ELEMENT_ROOT);
for (final IIndexerWorkItem aItem : aRemainingWorkItems)
eRoot.appendChild (MicroTypeConverter.convertToMicroElement (aItem, ELEMENT_ITEM));
if (MicroWriter.writeToFile (aDoc, m_aIndexerWorkItemFile).isFailure ())
throw new IllegalStateException ("Failed to write IndexerWorkItems to " + m_aIndexerWorkItemFile);
}
// Unschedule the job to avoid problems on shutdown. Use the saved instance
// because GlobalQuartzScheduler.getInstance() would fail because the global
// scope is already in destruction.
m_aScheduler.unscheduleJob (m_aTriggerKey);
// Close Lucene index etc.
m_aStorageMgr.close ();
}
示例8: convertToNative
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Nullable
public IndexerWorkItem convertToNative (@Nonnull final IMicroElement aElement)
{
final IIdentifierFactory aIdentifierFactory = PDMetaManager.getIdentifierFactory ();
final String sID = aElement.getAttributeValue (ATTR_ID);
final LocalDateTime aCreationDT = aElement.getAttributeValueWithConversion (ATTR_CREATION_DATE_TIME,
LocalDateTime.class);
final String sParticipantID = aElement.getAttributeValue (ATTR_PARTICIPANT_ID);
final IParticipantIdentifier aParticipantID = aIdentifierFactory.parseParticipantIdentifier (sParticipantID);
if (aParticipantID == null)
throw new IllegalStateException ("Failed to parse participant identifier '" + sParticipantID + "'");
final String sTypeID = aElement.getAttributeValue (ATTR_TYPE);
final EIndexerWorkItemType eType = EIndexerWorkItemType.getFromIDOrNull (sTypeID);
if (eType == null)
throw new IllegalStateException ("Failed to parse type ID '" + sTypeID + "'");
final String sOwnerID = aElement.getAttributeValue (ATTR_OWNER_ID);
final String sRequestingHost = aElement.getAttributeValue (ATTR_HOST);
return new IndexerWorkItem (sID, aCreationDT, aParticipantID, eType, sOwnerID, sRequestingHost);
}
示例9: convertToNative
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Nullable
public ReIndexWorkItem convertToNative (@Nonnull final IMicroElement aElement)
{
final IIndexerWorkItem aWorkItem = MicroTypeConverter.convertToNative (aElement.getFirstChildElement (ELEMENT_WORK_ITEM),
IndexerWorkItem.class);
final LocalDateTime aMaxRetryDT = aElement.getAttributeValueWithConversion (ATTR_MAX_RETRY_DT, LocalDateTime.class);
final String sRetryCount = aElement.getAttributeValue (ATTR_RETRY_COUNT);
final int nRetryCount = StringParser.parseInt (sRetryCount, -1);
if (nRetryCount < 0)
throw new IllegalStateException ("Invalid retry count '" + sRetryCount + "'");
final LocalDateTime aPreviousRetryDT = aElement.getAttributeValueWithConversion (ATTR_PREVIOUS_RETRY_DT,
LocalDateTime.class);
final LocalDateTime aNextRetryDT = aElement.getAttributeValueWithConversion (ATTR_NEXT_RETRY_DT,
LocalDateTime.class);
return new ReIndexWorkItem (aWorkItem, aMaxRetryDT, nRetryCount, aPreviousRetryDT, aNextRetryDT);
}
示例10: convertToNative
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Nonnull
public T convertToNative (final IMicroElement aElement)
{
// Create new settings object
final String sSettingsName = aElement.getAttributeValue (ATTR_NAME);
final T aSettings = m_aSettingFactory.apply (sSettingsName);
// settings are only on the top-level
aElement.forAllChildElements (eSetting -> {
final String sFieldName = eSetting.getAttributeValue (ATTR_NAME);
final String sClass = eSetting.getAttributeValue (ATTR_CLASS);
final Class <?> aDestClass = GenericReflection.getClassFromNameSafe (sClass);
if (aDestClass == null)
throw new IllegalStateException ("Failed to determine class from '" + sClass + "'");
final Object aValue = MicroTypeConverter.convertToNative (eSetting.getFirstChildElement (ELEMENT_VALUE),
aDestClass);
// Use put instead of putIn to avoid that the callbacks are invoked!
aSettings.put (sFieldName, aValue);
});
return aSettings;
}
示例11: onKeyedSize
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Override
public void onKeyedSize (final String sName, final IStatisticsHandlerKeyedSize aHandler)
{
if (aHandler.getInvocationCount () > 0)
{
final IMicroElement eKeyedSize = m_eRoot.appendElement (StatisticsExporter.ELEMENT_KEYEDSIZE)
.setAttribute (StatisticsExporter.ATTR_NAME, sName)
.setAttribute (StatisticsExporter.ATTR_INVOCATIONCOUNT,
aHandler.getInvocationCount ());
for (final String sKey : aHandler.getAllKeys ().getSorted (Comparator.naturalOrder ()))
{
eKeyedSize.appendElement (StatisticsExporter.ELEMENT_KEY)
.setAttribute (StatisticsExporter.ATTR_NAME, sKey)
.setAttribute (StatisticsExporter.ATTR_INVOCATIONCOUNT, aHandler.getInvocationCount (sKey))
.setAttribute (StatisticsExporter.ATTR_MIN, aHandler.getMin (sKey))
.setAttribute (StatisticsExporter.ATTR_AVERAGE, aHandler.getAverage (sKey))
.setAttribute (StatisticsExporter.ATTR_MAX, aHandler.getMax (sKey))
.setAttributeWithConversion (StatisticsExporter.ATTR_SUM, aHandler.getSum (sKey));
}
}
}
示例12: onKeyedCounter
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Override
public void onKeyedCounter (final String sName, final IStatisticsHandlerKeyedCounter aHandler)
{
if (aHandler.getInvocationCount () > 0)
{
final IMicroElement eKeyedCounter = m_eRoot.appendElement (StatisticsExporter.ELEMENT_KEYEDCOUNTER)
.setAttribute (StatisticsExporter.ATTR_NAME, sName)
.setAttribute (StatisticsExporter.ATTR_INVOCATIONCOUNT,
aHandler.getInvocationCount ());
for (final String sKey : aHandler.getAllKeys ().getSorted (Comparator.naturalOrder ()))
{
eKeyedCounter.appendElement (StatisticsExporter.ELEMENT_KEY)
.setAttribute (StatisticsExporter.ATTR_NAME, sKey)
.setAttribute (StatisticsExporter.ATTR_INVOCATIONCOUNT, aHandler.getInvocationCount (sKey))
.setAttribute (StatisticsExporter.ATTR_COUNT, aHandler.getCount (sKey));
}
}
}
示例13: convertToMicroElement
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Nonnull
public IMicroElement convertToMicroElement (@Nonnull final BorderStyleSpec aValue,
@Nullable final String sNamespaceURI,
@Nonnull final String sTagName)
{
final IMicroElement aElement = new MicroElement (sNamespaceURI, sTagName);
final Color aColor = aValue.getColor ();
if (aColor != BorderStyleSpec.DEFAULT_COLOR)
aElement.appendChild (MicroTypeConverter.convertToMicroElement (aColor, sNamespaceURI, ELEMENT_COLOR));
final LineDashPatternSpec aLDPSpec = aValue.getLineDashPattern ();
if (aLDPSpec != BorderStyleSpec.DEFAULT_LINE_DASH_PATTERN)
aElement.appendChild (MicroTypeConverter.convertToMicroElement (aLDPSpec,
sNamespaceURI,
ELEMENT_LINE_DASH_PATTERN));
aElement.setAttribute (ATTR_LINE_WIDTH, aValue.getLineWidth ());
return aElement;
}
示例14: convertToNative
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Nonnull
public LineDashPatternSpec convertToNative (@Nonnull final IMicroElement aElement)
{
final float fPhase = StringParser.parseFloat (aElement.getAttributeValue (ATTR_PHASE), Float.NaN);
final ICommonsList <IMicroElement> aChildren = aElement.getAllChildElements (ELEMENT_PATTERN);
final float [] aPattern = new float [aChildren.size ()];
int nIndex = 0;
for (final IMicroElement ePattern : aChildren)
{
aPattern[nIndex] = ePattern.getAttributeValueAsFloat (ATTR_ITEM, Float.NaN);
if (Float.isNaN (aPattern[nIndex]))
aPattern[nIndex] = ePattern.getAttributeValueAsFloat ("patternitem", Float.NaN);
nIndex++;
}
return new LineDashPatternSpec (aPattern, fPhase);
}
示例15: readNameFromXML
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
/**
* Read a <name> element
*
* @param eName
* The source micro element. Never <code>null</code>.
* @return The created domain object. May not be <code>null</code>.
*/
@Nonnull
public PSName readNameFromXML (@Nonnull final IMicroElement eName)
{
final PSName ret = new PSName ();
eName.forAllAttributes ( (sNS, sAttrName, sVal) -> {
final String sAttrValue = _getAttributeValue (sVal);
if (sAttrName.equals (CSchematronXML.ATTR_PATH))
ret.setPath (sAttrValue);
else
ret.addForeignAttribute (sAttrName, sAttrValue);
});
eName.forAllChildElements (eNameChild -> {
if (CSchematron.NAMESPACE_SCHEMATRON.equals (eNameChild.getNamespaceURI ()))
{
_warn (ret, "Unsupported Schematron element '" + eNameChild.getLocalName () + "'");
}
else
_warn (ret, "Unsupported namespace URI '" + eNameChild.getNamespaceURI () + "'");
});
return ret;
}