本文整理汇总了Java中com.helger.xml.microdom.IMicroElement类的典型用法代码示例。如果您正苦于以下问题:Java IMicroElement类的具体用法?Java IMicroElement怎么用?Java IMicroElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMicroElement类属于com.helger.xml.microdom包,在下文中一共展示了IMicroElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:phax,项目名称:ph-as4,代码行数:17,代码来源:PModeLegMicroTypeConverter.java
示例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;
}
开发者ID:phax,项目名称:ph-as4,代码行数:19,代码来源:PModeLegBusinessInformationMicroTypeConverter.java
示例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;
}
开发者ID:phax,项目名称:ph-as4,代码行数:22,代码来源:PModeLegErrorHandlingMicroTypeConverter.java
示例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);
}
开发者ID:phax,项目名称:ph-as4,代码行数:24,代码来源:PModeLegErrorHandlingMicroTypeConverter.java
示例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;
}
开发者ID:phax,项目名称:ph-as4,代码行数:27,代码来源:PModeMicroTypeConverter.java
示例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");
});
}
开发者ID:phax,项目名称:peppol-directory,代码行数:18,代码来源:PageSecureAllParticipants.java
示例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 ();
}
开发者ID:phax,项目名称:peppol-directory,代码行数:24,代码来源:PDIndexerManager.java
示例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);
}
开发者ID:phax,项目名称:peppol-directory,代码行数:26,代码来源:IndexerWorkItemMicroTypeConverter.java
示例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);
}
开发者ID:phax,项目名称:peppol-directory,代码行数:22,代码来源:ReIndexWorkItemMicroTypeConverter.java
示例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;
}
开发者ID:phax,项目名称:ph-commons,代码行数:23,代码来源:SettingsMicroDocumentConverter.java
示例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));
}
}
}
开发者ID:phax,项目名称:ph-commons,代码行数:22,代码来源:StatisticsVisitorCallbackToXML.java
示例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));
}
}
}
开发者ID:phax,项目名称:ph-commons,代码行数:19,代码来源:StatisticsVisitorCallbackToXML.java
示例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;
}
开发者ID:phax,项目名称:ph-pdf-layout,代码行数:22,代码来源:BorderStyleSpecMicroTypeConverter.java
示例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);
}
开发者ID:phax,项目名称:ph-pdf-layout,代码行数:18,代码来源:LineDashPatternSpecMicroTypeConverter.java
示例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;
}
开发者ID:phax,项目名称:ph-schematron,代码行数:31,代码来源:PSReader.java
示例16: convertToMicroElement
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Nullable
public static <T> IMicroElement convertToMicroElement (@Nullable final T aObject,
@Nullable final String sNamespaceURI,
@Nonnull @Nonempty final String sTagName) throws TypeConverterException
{
ValueEnforcer.notEmpty (sTagName, "TagName");
if (aObject == null)
return null;
// Lookup converter
final Class <T> aSrcClass = GenericReflection.uncheckedCast (aObject.getClass ());
final IMicroTypeConverter <T> aConverter = MicroTypeConverterRegistry.getInstance ()
.getConverterToMicroElement (aSrcClass);
if (aConverter == null)
throw new TypeConverterException (aSrcClass, IMicroElement.class, EReason.NO_CONVERTER_FOUND);
// Perform conversion
final IMicroElement ret = aConverter.convertToMicroElement (aObject, sNamespaceURI, sTagName);
if (ret == null)
throw new TypeConverterException (aSrcClass, IMicroElement.class, EReason.CONVERSION_FAILED);
return ret;
}
开发者ID:phax,项目名称:ph-commons,代码行数:24,代码来源:MicroTypeConverter.java
示例17: convertToNative
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Nullable
public static <DSTTYPE> DSTTYPE convertToNative (@Nullable final IMicroElement aElement,
@Nonnull final Class <DSTTYPE> aDstClass,
@Nullable final DSTTYPE aNullValue) throws TypeConverterException
{
ValueEnforcer.notNull (aDstClass, "DestClass");
if (aElement == null)
return aNullValue;
// Lookup converter
final IMicroTypeConverter <DSTTYPE> aConverter = MicroTypeConverterRegistry.getInstance ()
.getConverterToNative (aDstClass);
if (aConverter == null)
throw new TypeConverterException (IMicroElement.class, aDstClass, EReason.NO_CONVERTER_FOUND);
// Perform conversion
final DSTTYPE ret = aConverter.convertToNative (aElement);
if (ret == null)
throw new TypeConverterException (IMicroElement.class, aDstClass, EReason.CONVERSION_FAILED);
return ret;
}
开发者ID:phax,项目名称:ph-commons,代码行数:23,代码来源:MicroTypeConverter.java
示例18: convertToNative
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Nonnull
public PostalAddress convertToNative (@Nonnull final IMicroElement eAddress)
{
final Locale aLocale = SystemHelper.getSystemLocale ();
final EPostalAddressType eType = EPostalAddressType.getFromIDOrNull (eAddress.getAttributeValue (ATTR_TYPE));
final String sCountry = eAddress.getAttributeValue (ATTR_COUNTRY);
final String sState = eAddress.getAttributeValue (ATTR_STATE);
final String sPostalCode = eAddress.getAttributeValue (ATTR_POSTALCODE);
final String sCity = eAddress.getAttributeValue (ATTR_CITY);
final String sStreet = eAddress.getAttributeValue (ATTR_STREET);
final String sBuildingNumber = eAddress.getAttributeValue (ATTR_BUILDINGNUMBER);
final String sPostOfficeBox = eAddress.getAttributeValue (ATTR_POBOX);
final String sCareOf = eAddress.getAttributeValue (ATTR_CARE_OF);
return new PostalAddress (eType,
sCountry,
sState,
sPostalCode,
sCity,
sStreet,
sBuildingNumber,
sPostOfficeBox,
sCareOf,
aLocale);
}
开发者ID:phax,项目名称:ph-masterdata,代码行数:25,代码来源:PostalAddressMicroTypeConverter.java
示例19: readValueOfFromXML
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
/**
* Read a <value-of> element
*
* @param eValueOf
* The source micro element. Never <code>null</code>.
* @return The created domain object. May not be <code>null</code>.
*/
@Nonnull
public PSValueOf readValueOfFromXML (@Nonnull final IMicroElement eValueOf)
{
final PSValueOf ret = new PSValueOf ();
eValueOf.forAllAttributes ( (sNS, sAttrName, sVal) -> {
final String sAttrValue = _getAttributeValue (sVal);
if (sAttrName.equals (CSchematronXML.ATTR_SELECT))
ret.setSelect (sAttrValue);
else
ret.addForeignAttribute (sAttrName, sAttrValue);
});
eValueOf.forAllChildElements (eValueOfChild -> {
if (CSchematron.NAMESPACE_SCHEMATRON.equals (eValueOfChild.getNamespaceURI ()))
{
_warn (ret, "Unsupported Schematron element '" + eValueOfChild.getLocalName () + "'");
}
else
_warn (ret, "Unsupported namespace URI '" + eValueOfChild.getNamespaceURI () + "'");
});
return ret;
}
开发者ID:phax,项目名称:ph-schematron,代码行数:31,代码来源:PSReader.java
示例20: testMarshal
import com.helger.xml.microdom.IMicroElement; //导入依赖的package包/类
@Test
public void testMarshal ()
{
final Locale aLocale = Locale.GERMAN;
final PostalAddress aAddress = new PostalAddress ();
aAddress.setStreet ("Cumberlandstraße", aLocale);
aAddress.setPostalCode ("1140");
aAddress.setCity ("Vienna", aLocale);
aAddress.setState ("W", aLocale);
aAddress.setCountry ("AT", aLocale);
final IMicroElement aElement = MicroTypeConverter.convertToMicroElement (aAddress, "addr");
assertNotNull (aElement);
s_aLogger.info (MicroWriter.getNodeAsString (aElement));
final PostalAddress aAddress2 = MicroTypeConverter.convertToNative (aElement, PostalAddress.class);
assertEquals (aAddress, aAddress2);
}
开发者ID:phax,项目名称:ph-masterdata,代码行数:18,代码来源:AddressMicroTypeConverterRegistrarTest.java
注:本文中的com.helger.xml.microdom.IMicroElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论